edderic
Programmer
- May 8, 1999
- 628
i have a problem with Excel read data with ADO connection.
'connect to the excel file using ADO
Set cnExcel = New ADODB.Connection
Set rstExcel = New ADODB.Recordset
xlConString = "Provider=MSDASQL.1;Driver={Microsoft Excel Driver (*.xls)};DBQ=" & CommonDialog1.FileName
cnExcel.Open xlConString
rstExcel.Open "Zone", cnExcel
The problem is the first columns of Excel are different data:
"212 12 2228"
"213 13 2229"
"21345"
The moment on the record "21345" give VB a Error 94 = Null
ho can i solve this problem?
Eric
Eric De Decker
vbg.be@vbgroup.nl
'connect to the excel file using ADO
Set cnExcel = New ADODB.Connection
Set rstExcel = New ADODB.Recordset
xlConString = "Provider=MSDASQL.1;Driver={Microsoft Excel Driver (*.xls)};DBQ=" & CommonDialog1.FileName
cnExcel.Open xlConString
rstExcel.Open "Zone", cnExcel
The problem is the first columns of Excel are different data:
"212 12 2228"
"213 13 2229"
"21345"
The moment on the record "21345" give VB a Error 94 = Null
ho can i solve this problem?
Eric
Eric De Decker
vbg.be@vbgroup.nl