I would like to import data from a text file into my access database using vba. I have alot of text files to import so i would like to automate it. Any ideas how to go about doing this. The data is sererated by commas.
Ok i added the extension to the file name (txt). It imports the file but only the first info before the ;.
Example:
Thisis what the file that i want to import look like:
"ABC GOURMET CATERING";"";"";"916450132";"CALLE TORRES QUEVEDO, 4";"MOSTOLES";"MOSTOLES";"28936";"MADRID"
I only get ABC GOURMET CATERING in my access table.
You will need to create a SpecificationName to tell access that the delimiter identifier is ";" not "," to get it to import properly.
To do this select any table and choose File->Export
When the prompt opens change the save as type to Text Files
When the export text wizard opens click on the advanced button. Change the Field Delimiter to ";" then click on the save as button. Enter the name you want for that spec and change your code to this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.