Question AcimportDelim Import a CSV file

antonio.manoj.derose

Registered User.
Local time
Today, 20:34
Joined
Jul 4, 2013
Messages
62
Hi All,

Good morning to all, I am facing an issue while working on VBA Access.

  • I am trying to load a csv file by coding, which is DoCmd.TransferText acImportDelim, "", "tblTempPayments", newFilename, False
  • One field which I have declared as Text, some rows for the fields are numeric, some rows are text, and some are alphanumeric.
  • Regardless, of the fields being declared as Text, it is throwing an error by creating an additional table naming temp_importerrors, and having 3 fields for Error, Field and Row, so in my view it is taking the majority of the rows, thinking a data type on the majority of the data type, and others being error out.
  • The only work around that was successful for me, is placing that relevant values wit double quotes.
  • However I do not how to do it, by coding.
So, please help me in finding the code, for me in getting the import values between quotes, better if I can get it for that relevant field, if not all the fields.

Thanks,

Anton
 
Much easier to set up an Import Specification creating a Temp table to import to. Then you can set you fields to what ever Data Type you like. Once safely in the Temp table you can push to the Live table via an APPEND or UPDATE query and then empty Temp table for next use.
 
Hi Gina,

Yes it worked in that way, putting a specification on it's own, the options text qualifier and the separator came in really handy.

Thanks,

Antonio Manoj
 
Happy to hear that worked and thanks for reporting back! :D
 

Users who are viewing this thread

Back
Top Bottom