Solved

Delphi/Excel: how to bypass rowscan

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 89
how to center only a line in richedit? 4 56
Delphi Form ownership 4 88
how to resize animated Gif image in delphi ? 1 30
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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