Solved

Delphi/Excel: how to bypass rowscan

Posted on 2001-06-20
4
253 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now