Import CSV files

J

JIM.H.

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?
 
V

Van T. Dinh

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"
 
Top