Solved

Delphi/Excel: how to bypass rowscan

Posted on 2001-06-20
4
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: 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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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