I have several CSV files that I need to import into existing tables in an Access database on a weekly basis. I'm running the macro from Excel, since it executes several functions (including saving a time-stamped copy of the file to an archive folder) before proceeding with the upload.
My code is as follows:
Dim objAccess As New Access.Application
ase "DATABASE.mdb", False
xt acImportDelim, , "Table_Name", "CSV_File.csv", False
Note that I've specified that the file does not include a header row. However, when I try to execute this I receive a "Field (F1) does not exist" error.
While searching for a solution, I found this thread on EE:
However, I'm not clear on what the ultimate solution was. Is it possible to directly import a CSV file into an existing Access table? This thread almost sounds like it's necessary to create a temp table first.