Export to CSV with ; not ,

G

Guest

Hi,

I use the following export code to export from access 2003 to a CSV file,
but after this I need to import the file to a website and the website only
accepts the seperator ; but what I try I always can the commaseparator (,)
Can someone please help me how to get an ; as separator.

The code:

Public Function Export()

On Error GoTo Err_export1
Dim AString As String
AString = "Import"
DoCmd.TransferText acExportDelim, "", "csv", "c:\import\export\" & AString &
Format(Date, "_DDMM") & ".csv"
Exit_export1:
Exit Function
Err_export1:
MsgBox Err.Description
Resume Exit_export1

End Function


Please help me !!
 
K

Ken Snell \(MVP\)

Create an export specification (do the export manually, click on the
Advanced button in the wizard window, and save the settings -- with ; as the
delimiter) with a name such as SemiColonExport. Then use the export
specification name as the second argument in your TransferText step:

DoCmd.TransferText acExportDelim, "SemiColonExport", "csv",
"c:\import\export\" & AString &
Format(Date, "_DDMM") & ".csv"
 
G

Guest

Manually do an export. When the Export Text Wizard pops up, go to the
Advanced button on the lower left. You will find an option for changing the
field delimiter to a ";" . Do a Save As to a name like SemicolonCSV. Modify
your code like so to use this export specification:

DoCmd.TransferText acExportDelim, "SemicolonCSV", "csv",
"c:\import\export\" & AString & Format(Date, "_DDMM") & ".csv"
 
G

Guest

Thanks !!! it works !!

Ken Snell (MVP) said:
Create an export specification (do the export manually, click on the
Advanced button in the wizard window, and save the settings -- with ; as the
delimiter) with a name such as SemiColonExport. Then use the export
specification name as the second argument in your TransferText step:

DoCmd.TransferText acExportDelim, "SemiColonExport", "csv",
"c:\import\export\" & AString &
Format(Date, "_DDMM") & ".csv"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top