Import multiple csv files into an Access table (1 Viewer)

gsrai31

Registered User.
Local time
Today, 05:43
Joined
Aug 30, 2003
Messages
44
Hi all
Can someone pls help me to automate the following import routine.
  • I have a table in MS Access called "Data_Csv"
  • I import a number of csv files manually, files are named as follows - "data Jan07.csv", "data Feb07.csv", "data Mar07.csv" and so on....names always begin with "data*.csv".
  • The number of files can be different everytime I import these.
  • Before importing these files I want to delete existing data from "Data_Csv" table.
  • The data files have no field headers.
  • Spec I use to import these files is "Data_csv Import Specification".
  • Directory where the data files are = C:\My Documents\Export 2007\Datafiles\data Jan07.csv"
Hope this all makes sense. If not please let me know I can try to explain again. Thanks in Advance.
gsrai31
 

boblarson

Smeghead
Local time
Yesterday, 21:43
Joined
Jan 12, 2001
Messages
32,059
Hope this all makes sense. If not please let me know I can try to explain again. Thanks in Advance.
gsrai31
Are you familiar with the DoCmd.TransferText method? If you go into the VBA Help file it will show you what you need to use it.

Also, to delete the data use a Delete Query to remove all of the records.
 

Users who are viewing this thread

Top Bottom