I have the follow code extract where I access the contects of a text file through ADO and run a SQL query to populate a table with the text file contents. This work fine apart from some fields which the text driver is assuming is a long integer and I need to access the field as a text data type. Is there any way of forcing the text driver to assume all fields are text and not allow it to guess the data type
here is the code extract
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & gsProgRoot & "aus_gsp_cdr.mdb"
sSQL = "INSERT INTO myTable & _ (REC_CODE,TYPE_CALL,......OUTP_NUM )" & _
"SELECT f1, f2, f3, f4,......f36, f37 FROM " & _
"[Text;Database=" & gsEDMPath_Syd & ";HDR=NO;FMT=Delimited].[myfile.txt]"
cn.Execute sSQL
here is the code extract
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & gsProgRoot & "aus_gsp_cdr.mdb"
sSQL = "INSERT INTO myTable & _ (REC_CODE,TYPE_CALL,......OUTP_NUM )" & _
"SELECT f1, f2, f3, f4,......f36, f37 FROM " & _
"[Text;Database=" & gsEDMPath_Syd & ";HDR=NO;FMT=Delimited].[myfile.txt]"
cn.Execute sSQL