kabirpatel
Programmer
"Field 'F1' doesn't exist in destination table 'tablename.'"
I hate this error message.
I am using the following command to load data from an excel spreadsheet into a backend SQL Server database via an .adp:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel7, sTempTable, strFileName, False, "A2:B4000"
I have purposely used "False" to ensure that the first line in my spreadsheet is ignored. This is because the first line in my spreadsheet contains headings that do not match the column names in my table.
I do not wish to change my headings as end users will be making use of my application and they will not like headings such as "int_FactoryID". Likewise I do not want to change the column names in my table to words such as "Factory ID" as this would be a bad naming convention.
Is there a way to use TransferSpreadsheet without necessarily matching the headings in the spreadsheet to the column headings?
Is there a way for TransferSpreadsheet to ignore the headings and assume that the first column in the spreadsheet needs to go to the first column in my SQL Server table?
Any help would be appreciated.
Thanks
Kabir