I am using A2007 and 2003. I would like to import a csv file. I don't want to use an import specification name because it is sensitive to column order In this application, the column order in the csv file can change. I found this simple code: on several sites.
DoCmd.TransferText TransferType:=acImportDelim, TableName:="MyTableName", _
FileName:=myPath & "MyCsvFile.csv", HasFieldNames:=True
When I run it, I get message error 3209 "the search key was not found in any record"
If I change acImportDelim to acLinkDelim, the code works fine and links to the csv file. I get rid of the column order problem, but get a new one in that Access assigns a format based on the first few items in a column. If the first few items are numbers and further down the column, there is an item with text and numbers, it rejects the item.
Is there some way to import csv to an access table without using a spec? Any help much appreciated.