Solved

Importing XLS files

Posted on 2006-07-05
5
478 Views
Last Modified: 2011-09-20
Dear Experts,

Is there any good freeware components to work with XLS files (Excel)?
For example I need to import all the sheets of Excel file.


Any help appreciated!
0
Comment
Question by:Marius0188
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:ciuly
ID: 17040776
Hi Marius0188,

you could use the activex controls. or if you have delphi 6 or later, when installing you have the option of installing office components.

But you didn't mention: import the sheets into what?
because if you just what to take out the data, you can also use MDAC (using odbc or ado if my memory servers me correctly)

Cheers!
0
 

Author Comment

by:Marius0188
ID: 17041097
1. Scenario 1: I would like to import the data into a firebird table and create the fields dynamically.
   
2. Scenario 2: And in some situations I would just like to populate a ListView with all the data in the Excel.

3. Do you have example of how to work with the TAdoConnection? Is this a db aware component?
0
 
LVL 28

Accepted Solution

by:
ciuly earned 125 total points
ID: 17041181
3)

TAdoConnection is used to connect to different DBs so yes, we can say that it's db aware.

here is a pretty good tutorial on how to get the data out of excel http://delphi.about.com/od/database/l/aa090903a.htm

1) I never worked with firebird but I guess it's the same thing. after you get the table out of excel it's only a matter of iterating through the rows and adding each one to the db. Using ADO in both connections, you might be able to also do a direct table-table copy using ADOTable.Clone method

2) for this you will have to manually iterate through the dataset from excel
0
 

Author Comment

by:Marius0188
ID: 17041257
How can I convert the Excel file to a CSV format wherafter I can the iterate through the data?
0
 
LVL 28

Expert Comment

by:ciuly
ID: 17041458
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

20 Experts available now in Live!

Get 1:1 Help Now