Solved

Delphi/Excel: how to bypass rowscan

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

Technology Partners: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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 this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses
Course of the Month4 days, 18 hours left to enroll

636 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