Solved

Delphi/Excel: how to bypass rowscan

Posted on 2001-06-20
4
256 Views
Last Modified: 2010-04-06
In Delphi i use an odbc gateway to an excel spreadsheet. The problem with the odbc gateway is that it scans a number of rows to determine the data type of each column...  The data type is determined given the maximum number of kinds of data found. If data is encountered that does not match the data type guessed for the column, the data type will be returned as a NULL value.

I have xls files with different types on different rows.
What to do.
0
Comment
Question by:R4Speerstra
4 Comments
 
LVL 1

Accepted Solution

by:
Greyman earned 100 total points
ID: 6212602
If you can force the data type to be String - (using static field definitions) that might help - you could then handle all of the type issues for yourself.

Alternatively, you could use OLE instead, this will give you a lot more power and flexibility.
0
 
LVL 1

Expert Comment

by:Phoenix_s
ID: 6212917
to be honest, I have found using excel with odbc a royal pain in the butt.

I totally agree with GreyMan in that you should use OLE to access the data on the excel spreadsheet because you can specifically query the datatype of any cell and get the proper and correct datatype, not something based on the maximum value.

but.. on the other hand, OLE is not like using a database either.. so you'd have to deal with the current problem you have, or recode a lot of stuff...

or!  export the excel spreadsheets to access or something and just redefine your alias
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8684960
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept GreyMan's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question