Discussion Locked

Excel 2000/ADO data type confusion

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
With automation using ADOs, it seems that whenever a client sends an Excel spreadsheet with no formatting (schema), connecting to the spreadsheet via ADOs seems to trigger the Microsoft Jet Engine driver to determine data types for fields. On a zipcode field that comes as "General", if the first 5 records have no alphas, the driver calls it Long Integer and fails to accept foreign zipcodes with alphas or other formats. Is there a programming solution or a driver patch to resolve this issue?NOTE: this problem is not just an Excel 2000 problem...Access 2000 and SQL 2000 behave exactly the same with the same spreadsheets.

2 replies

by mslizny

I usually save data in Excel as tab-delimited text. When you open up this file in Excel it then asks if you want to define a data type. If you do, you can designate "General" types as "text" fields, not number fields, so that the date in them willbe able to accept both numeric and alpha characters.

Since Excel allows the recording of macros, this should be easily automated.

by ksoibel

this is to be dynamic with the use of ADOs from VC++/VB and not require pre-determined spreadsheet formats/macros or manual operations.

This discussion is closed to new replies.