Article View: borland.public.cppbuilder.database.ado
Article #930Re: How to create an Excel file from a Cpp builder 5 pgm using ADO Express
From: jayo
Date: Sun, 13 Mar 2005 19:49
Date: Sun, 13 Mar 2005 19:49
81 lines
2826 bytes
2826 bytes
This is what works:
ADOCommand1->CommandText = "SELECT * INTO [PAGOS1] IN
\"D:\\Temp\\LISTAPAGOS.XLS\" [Excel 8.0;] FROM [PAGOS]";
Jesus
"jayo" <jayo1.geo@yahoo.com> escribi� en el mensaje
news:42330302@newsgroups.borland.com...
> Para dejar traza: (del correo que me hizo favor de responder Viatcheslav)
>
> Your query should look as:
>
> SELECT * INTO [pagos] IN "" [Excel 8.0;Database=d:\temp\listapagos.xls]
> FROM [pagos]
>
> This one should work. Do not forget to escape " and \ characters in code.
>
>
> QuickRep1->Free();
>
> QuickRep1->~TQuickRep();
>
>
>
> ADOCommand1->Free();
>
> ADOCommand1->~TADOCommand();
>
>
>
> It is not correct. Use "delete QuickRep1;" and "delete ADOCommand1;"
> instead.
>
>
>
>
> Regards,
> Viatcheslav V. Vassiliev
> "jayo" <jayo1.geo@yahoo.com> escribi� en el mensaje
> news:422f0b26@newsgroups.borland.com...
>> I'm using BCB 5, with ADO Express I create an Access database, with a
>> table. I want that table in an Excel file. I am doing:
>> .
>> .
>> .
>> ADOConnection1->ConnectionString = bt; // Access
>> ADOConnection1->Open();
>> ADOTable1->Connection= ADOConnection1;
>> ADOTable1->TableName= L"PAGOS";
>> ADOTable1->Open();
>> .
>> .
>> ADOTable1->Append();
>> ADOTable1->FieldValues[AnsiString("CCLIENTE")]=AnsiString(clien);
>> ADOTable1->FieldValues[AnsiString("NCLIENTE")]=AnsiString(nombre);
>> .
>> .
>> ADOTable1->Post();
>> .
>> .
>> WideString yt="SELECT * INTO Excel 10.0;DATABASE= LISTAPAGOS.PAGOS FROM
>> PAGOS";
>> ADOConnection1->Execute(yt, ?, ?); // What parameters to use ? ERROR
>> .
>> .
>> QuickRep1->Preview();
>> QuickRep1->Free();
>> QuickRep1->~TQuickRep();
>> ADOTable1->Close();
>> ADOConnection1->Close();
>>
>> Thank you very much in advance.
>> Jesus
>>
>
>
Technical Details
Message-ID:
<42349968@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<422f0b26@newsgroups.borland.com> <42330302@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,2e49c0607a2d6636 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "jayo" <jayo1.geo@yahoo.com> Newsgroups: borland.public.cppbuilder.database.ado References: <422f0b26@newsgroups.borland.com> <42330302@newsgroups.borland.com> Subject: Re: How to create an Excel file from a Cpp builder 5 pgm using ADO Express Date: Sun, 13 Mar 2005 13:49:58 -0600 Lines: 83 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 148.240.98.251 Message-ID: <42349968@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1110743400 148.240.98.251 (13 Mar 2005 11:50:00 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail