Reputation: 29
I'm trying to export a table Final2 as a CSV file from Access 2010. The CSV file generated has quotation marks. How do I remove the quotes from the CSV file?
I tried using the ImportExport Text macro, the VBA code for the macro looks like below:
Function Output_to_csv_macro()
On Error GoTo Output_to_csv_macro_Err
DoCmd.OpenQuery "abc", acViewNormal, acEdit
DoCmd.OpenTable "Final2", acViewNormal, acEdit
DoCmd.TransferText acExportDelim, "", "Final2", "C:\Users\Output file.csv", True, ""
DoCmd.Close acTable, "Final2"
Output_to_csv_macro_Exit:
Exit Function
Output_to_csv_macro_Err:
MsgBox Error$
Resume Output_to_csv_macro_Exit
End Function
Upvotes: 2
Views: 4043
Reputation: 1726
The DoCmd.TransferText without an export specification will always put the quotes in. If you'd like to do it without, you first need to set up an export specification, then reference that specification in your code.
Upvotes: 2