Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Export table produced by SQL Query to Excel or CSV

137 views
Skip to first unread message

Robert Edgar

unread,
Jun 26, 2001, 3:03:02 AM6/26/01
to
Does anyone know of a component (preferably free) that allows the table
produced by a TQUERY to be saved as either an Excel .XLS file, or as a text
.CSV file. I have D5, and am still trying to learn about ADO, but some of
our machines do not have Excel on them.


Woody

unread,
Jun 26, 2001, 11:30:26 AM6/26/01
to
Writing to a CSV is fairly simple and can be accomplished
fairly quickly. To write to an Excel file, either Excel
needs to be installed or at least the DAO (ADO) files. Look
around the DSP or Torry's for some good components for this.

Woody


"Robert Edgar" <robert...@wsh-tr.anglox.nhs.uk> wrote in
message news:3b383386$2_1@dnews...

Bill Todd (TeamB)

unread,
Jun 26, 2001, 12:14:02 PM6/26/01
to
You should be able to save data in Excel format using the Excel ODBC driver
or the Excel ADO driver. The following provides some information on using
ODBC.
----------------------------------------
To read an Excel worksheet:


Create an ODBC DSN that points to the Excel file.


Excel files will not appear in the TTable.TableName property drop-down.
Enter the worksheet file name with no extension followed by a $ in the
TableName property. You can optionally append a cell range. For exmaple:
projects$A2:J1000


To read all of the rows in the worksheet when specifying a cell range make
the ending row number larger than the last possible row.


If you really want to work with a table name then you can define a

named region in Excel, then that region will appear in the list of tables


--
Bill


Max Weise

unread,
Jun 27, 2001, 7:19:49 AM6/27/01
to
I have the same problem. I need to convert a TTable to an Excel-File. But i
didn't understood where to look for good components. What do you mean with
DSP and Torry's?

"Woody" <wood...@ih2000.net> schrieb im Newsbeitrag
news:3b38a9b6$1_1@dnews...

Bojan Leskosek

unread,
Jun 27, 2001, 12:04:41 PM6/27/01
to
Beside what Bill and Woddy told you, you can also use OLE automation. It
also gives you more freedom about editing and formatting. Of course, you
must have Excel (Office) installed.

For a quick start visit:
http://www.djpate.freeserve.co.uk/Automation.htm

To get help go to OLEAutomation newsgroup.

Bojan


Bill Todd (TeamB)

unread,
Jun 27, 2001, 12:40:44 PM6/27/01
to
Delphi Super Page = http://delphi.icm.edu.pl/
Torry's Delphi Pages = http://www.torry.net/index.htm

--
Bill


0 new messages