Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To the profs

Status
Not open for further replies.

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

 
you need to error trap. Its telling you its looking for something that is not there so it throws an error.
Todd Norris
Hope this helps !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top