Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / May 2005



Tip: Looking for answers? Try searching our database.

Reading Excel data with ADO ignores numerics

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
redrobbo666 - 30 May 2005 20:41 GMT
Hi,

I've set up a connection and recordset to access an Excel 2000 spreadsheet
from VB6 (pretty much as described in this article
http://support.microsoft.com/default.aspx?scid=kb;en-us;278973 ).
The recordset is returned OK, and I can read through the rows of data, but
ALL the cells containing numeric values have come through as NULL. I can't
see any options etc that I could change to affeect this. I've tried messing
around with the format of the cells in the spreadsheet, but with no luck.

Anyone ever come across this before?

Many thanks
Paul Clement - 31 May 2005 16:04 GMT
¤ Hi,
¤
¤ I've set up a connection and recordset to access an Excel 2000 spreadsheet
¤ from VB6 (pretty much as described in this article
¤ http://support.microsoft.com/default.aspx?scid=kb;en-us;278973 ).
¤ The recordset is returned OK, and I can read through the rows of data, but
¤ ALL the cells containing numeric values have come through as NULL. I can't
¤ see any options etc that I could change to affeect this. I've tried messing
¤ around with the format of the cells in the spreadsheet, but with no luck.
¤
¤ Anyone ever come across this before?

Include the IMEX parameter in your connection string:

cnn.Open _
  "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  "Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;"""

http://support.microsoft.com/default.aspx?scid=kb;en-us;194124

Paul
~~~~
Microsoft MVP (Visual Basic)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.