user3495451
user3495451

Reputation: 29

Export CSV file from Access without double quotes

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

Answers (1)

KevenDenen
KevenDenen

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

Related Questions