Board index » cppbuilder » Excel en SQL

Excel en SQL


2004-08-12 08:46:20 PM
cppbuilder16
I work with SQL server and I want to transform the database from sql to
Excel file, the enterprose softare from SQL can do this operation but how
can I perform this from Builder C++ 4
With kind regards
Tom
 
 

Re:Excel en SQL

This is example in JScriptYou should have no problems converting it to BCB:
var conn = new ActiveXObject("ADODB.Connection");
//Create Excel file or use existing one
conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.xls;Extended
properties=Excel 8.0");
//Copy data from MS SQL Server into Excel
conn.Execute("select * into authors from [ODBC;DRIVER=SQL
Server;SERVER=(local);DATABASE=pubs;].[authors]");
//Close connection
conn.Close();
conn = null;
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Tom" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях следующе?
Quote
I work with SQL server and I want to transform the database from sql to
Excel file, the enterprose softare from SQL can do this operation but how
can I perform this from Builder C++ 4

With kind regards

Tom


 

Re:Excel en SQL

var is not know by builder ?????
"Viatcheslav V. Vassiliev" < XXXX@XXXXX.COM >wrote in message
Quote
This is example in JScriptYou should have no problems converting it to
BCB:

var conn = new ActiveXObject("ADODB.Connection");
//Create Excel file or use existing one
conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.xls;Extended
properties=Excel 8.0");
//Copy data from MS SQL Server into Excel
conn.Execute("select * into authors from [ODBC;DRIVER=SQL
Server;SERVER=(local);DATABASE=pubs;].[authors]");
//Close connection
conn.Close();
conn = null;

//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Tom" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях следующе?
news: XXXX@XXXXX.COM ...
>I work with SQL server and I want to transform the database from sql to
>Excel file, the enterprose softare from SQL can do this operation but
how
>can I perform this from Builder C++ 4
>
>With kind regards
>
>Tom
>
>


 

{smallsort}