Re: Exporting ADOQuery Results to Excel
- From: "Ray Porter" <ray_porter@xxxxxxx>
- Date: Fri, 30 May 2008 16:25:44 -0400
This isn't very hard. You can just use the TExcelApplication component,
open Excel via automation and populate the spread*** with the data from
your database table. Email me off list and I'll send you some code samples.
Ray Porter
"Nirmal Singh" <nirmal.singh@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:48400c29@xxxxxxxxxxxxxxxxxxxxxxxxx
I now have two ADOQuery components on my form, Query1 with the results of a
query against an Oracle database, Query2 pointing to a blank *** in an
excel spread***. How do I tranfer the results of Query1 to Query2 and
then to the spread***?
Most of the search results I have found deal with transferring data within
sheets in an excel spreadsheet or from Acces to Excel.
Nirmal
"Ken" <kbsubsNotThisPart@xxxxxxxxxxxxxxxxxx> wrote in message
news:483fa460$1@xxxxxxxxxxxxxxxxxxxxxxxxx
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\MySpread***.xls;Extended Properties=Excel 8.0;Persist
Security Info=False"
Set the connection string property to the above string - the Excel 8.0
value for the extended property depends on the version of Excel you are
using IIRC the 8.0 applies to Office 2k versions and up.
You can use the connection string builder just remember to go to the All
page and add the Excel 8.0 value to the extended properties option.
You can now select a *** in the TableName property of the ADO table.
The available sheets will appear as the table names postfixed with a "$"
as mentioned previously.
"Nirmal Singh" <nirmal.singh@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Bill
I would appreciate any help you can give me with this.
I have an open ADOQuery1 with the results of a query against an Oracle
database.
I have created a dummy spread*** c:\test.xls. How do I get the results
of
ADOQuery1 into sheet1 of the spreadsheet?
I have tried creating a new spread*** via automation and inserting the
data values into the individual cells, but that is just too slow.
Nirmal
"Bill Todd [TeamB]" <no@xxxxxx> wrote in message
news:483eb570@xxxxxxxxxxxxxxxxxxxxxxxxx
You can control Excel via Automation.
You can use the Excel ODBC driver with the ADO components.
--
Bill Todd (TeamB)
.
- References:
- Exporting ADOQuery Results to Excel
- From: Nirmal Singh
- Re: Exporting ADOQuery Results to Excel
- From: Bill Todd [TeamB]
- Re: Exporting ADOQuery Results to Excel
- From: Nirmal Singh
- Re: Exporting ADOQuery Results to Excel
- From: Ken
- Re: Exporting ADOQuery Results to Excel
- From: Nirmal Singh
- Exporting ADOQuery Results to Excel
- Prev by Date: Re: Exporting ADOQuery Results to Excel
- Previous by thread: Re: Exporting ADOQuery Results to Excel
- Index(es):