I am trying to use an Insert Into query to select data from an Excel file and insert it into an Access table. The issue I'm having is one of the Excel columns can be letters, numbers or both. I would like to select the data as text, but I seem to only get blanks for the text and text/number entries. If I sort the Excel file so that a text item is in the first row, all data is converted. I have tried the following:
strSQL = "INSERT INTO tblImport ([TIMS Company Code]) " & _
"SELECT [TIMS Company Code] " & _
"FROM [Excel 8.0;HDR=YES;DATABASE=" & xlPath & "].[Manual Entry$];"
=========================================================================
strSQL = "INSERT INTO tblImport ([TIMS Company Code]) " & _
"SELECT CStr([TIMS Company Code]) " & _
"FROM [Excel 8.0;HDR=YES;DATABASE=" & xlPath & "].[Manual Entry$] " & _
"WHERE [TIMS Company Code] IS NOT NULL;"
=========================================================================
strSQL = "INSERT INTO tblImport ([TIMS Company Code]) " & _
"SELECT (CAST([TIMS Company Code]) AS TEXT) " & _
"FROM [Excel 8.0;HDR=YES;DATABASE=" & xlPath & "].[Manual Entry$];"
I have also looked into something called "schema.ini" but it seems a little over my head.
I appreciate any help someone can provide.
Jason