TransferText- Importing a CSV file

jammin140900

Registered User.
Local time
Tomorrow, 00:47
Joined
Aug 18, 2008
Messages
35
G'day all,

I've been trying to import a csv file using the transfertext code..eg:

Private Sub Command0_Click()
DoCmd.TransferText acImportDelim, , "tblRTO", "C:\Upload\RTO.csv", True
End Sub


and it brings forth an error message because from what I can work out is that it is trying to import each whole line into one field and its not happy because it obviously can't match the field name in the MS Access table.

In other words, it is not delimiting the each piece of data separated by a comma and instead trying to bring in the entire line per field. I've opened the CSV file in notepad (looks fine in Excel) and can confirm that each line is treated as a String hence the problem. Removing the quotation marks from the text file and then running the upload does the job perfectly.

My experience in csv files is very limited and its not feasible to ask the database operator to sit their removing quotation marks for over 2000 records each week!!! Could anyone offer me any advise please? Is their a way to save the file as text instead? Would that help?

Mark
 
You need to supply a schema file. See TransferText in MS-Access Help. You can use the wizard to create the Schema file or create it yourself.

.
 

Users who are viewing this thread

Back
Top Bottom