Import CSV files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need to read all the *.csv files under C:\Doc\ and import it to a table in
Access programmatically. After importing each file I want to move the file to
C:\Doc\Log.

How can I do this?
 
You can use the Dir() function to traverse through all the files with the
extension CSV in the directory. For each file, you can use the TransferText
method to import the CSV. Finally, use the Name method to move the file to
another directory.

Dir() and TransferText method are in Access VB Help. I can't find the Name
method in Help but the syntax example is:

Name "C:\Doc\AAA.csv" AS "C:\Doc\Log\AAA.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

Back
Top