Board index » cppbuilder » How to Convert TDataSet to TADO Recordset

How to Convert TDataSet to TADO Recordset


2007-08-23 07:29:22 PM
cppbuilder107
Hi,
I would like to be able to pass a TDataSet to the following function which
requires an ADO Recordset:
Rpt->Database->SetDataSource((Variant)ADOQuery1->Recordset,(Variant)3,(Variant)1);
Instead of passing an ADOQuery I would like to pass a TDataSet (i.e either a
BDE Query or Table).
Thanks in advance,
Sinead
 
 

Re:How to Convert TDataSet to TADO Recordset

You will have to creaet a wrapper, for example, using simple OLEDB provider.
It is not an easy task.
//------------------------------------------
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)
"Sinead Bunyan" < XXXX@XXXXX.COM >???????/???????? ? ????????
?????????: news: XXXX@XXXXX.COM ...
Quote
Hi,

I would like to be able to pass a TDataSet to the following function which
requires an ADO Recordset:

Rpt->Database->SetDataSource((Variant)ADOQuery1->Recordset,(Variant)3,(Variant)1);

Instead of passing an ADOQuery I would like to pass a TDataSet (i.e either
a
BDE Query or Table).

Thanks in advance,
Sinead

 

Re:How to Convert TDataSet to TADO Recordset

Hi Vassiliev,
Thank you for your help on this, at least now I know that it is possible and
can work from there.
Is there any possibility that you may be able to provide me with an example
of such a wrapper?
Thanks again for your help.
Regards,
Sinead
"Vassiliev V. V." < XXXX@XXXXX.COM >wrote in message
Quote
You will have to creaet a wrapper, for example, using simple OLEDB
provider. It is not an easy task.

//------------------------------------------
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)


"Sinead Bunyan" < XXXX@XXXXX.COM >???????/???????? ?
???????? ?????????: news: XXXX@XXXXX.COM ...
>Hi,
>
>I would like to be able to pass a TDataSet to the following function
>which
>requires an ADO Recordset:
>
>Rpt->Database->SetDataSource((Variant)ADOQuery1->Recordset,(Variant)3,(Variant)1);
>
>Instead of passing an ADOQuery I would like to pass a TDataSet (i.e
>either a
>BDE Query or Table).
>
>Thanks in advance,
>Sinead
>


 

{smallsort}

Re:How to Convert TDataSet to TADO Recordset

Quote
Thank you for your help on this, at least now I know that it is possible
and can work from there.
I believe the intent was to persuade you to not continue in this direction.
Perhaps you can explain a little about the types of 'Rpt' and 'Database' and
what functionality you are after. There might be other alternatives that
you can pursue once a little more is known about your problem.
- Clayton
 

Re:How to Convert TDataSet to TADO Recordset

Hi Clayton,
I am basically incorporating Crystal Reports 11 into an existing c++
project. Previously we had used a component from a company called Suprasoft,
which allowed us to pass a TDataSet to report templates and using TTX files
we could display our reports accordingly. In this way we did not have to
specify the data location when designing the reports.
However (!), we now are faced with using Crystal Reports 11, which requires
that data be passed to the reports as an ADO recordset. Because it is an
existing project, all datasets are created and ideally we would like a way
to work from the existing datasets - we do not want to change all TDataSet
components to TADODataSets and also we do not want to have to generate these
datasets twice (once to populate our TDataSet, and once to populate a
TADODataSet). Hopefully this is making sense?
Any suggestions would be greatly appreciated - I have a very limited
knowledge of ADO objects, sorry for my ignorance on this subject!
Thanks in advance,
Sinead
"Clayton Arends" < XXXX@XXXXX.COM >wrote in message
Quote
>Thank you for your help on this, at least now I know that it is possible
>and can work from there.

I believe the intent was to persuade you to not continue in this
direction.

Perhaps you can explain a little about the types of 'Rpt' and 'Database'
and what functionality you are after. There might be other alternatives
that you can pursue once a little more is known about your problem.

- Clayton


 

Re:How to Convert TDataSet to TADO Recordset

Intent was really to persuade you to not continue in this direction. Did
Crystal Reports stopped support BDE? If not, you could connect to BDE tables
directly, without datasets. Or connect to DBF/Paradox files with Jet OLEDB
provider (there may be problems with update Paradox tables, but in read-only
mode this may work).
If you still want to continue with creating recordset wrapper for TDataSet
(in this case through special OLEDB provider), look at:
www.dataweb.de/en/support/articles/ospdelphi/ospdelphi.html
msdn2.microsoft.com/en-us/library/aa160399(office.11).aspx
However it could take much more time and efforts than you expect.
//------------------------------------------
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)
"Sinead Bunyan" < XXXX@XXXXX.COM >???????/???????? ? ????????
?????????: news: XXXX@XXXXX.COM ...
Quote
Hi Clayton,

I am basically incorporating Crystal Reports 11 into an existing c++
project. Previously we had used a component from a company called
Suprasoft, which allowed us to pass a TDataSet to report templates and
using TTX files we could display our reports accordingly. In this way we
did not have to specify the data location when designing the reports.

However (!), we now are faced with using Crystal Reports 11, which
requires that data be passed to the reports as an ADO recordset. Because
it is an existing project, all datasets are created and ideally we would
like a way to work from the existing datasets - we do not want to change
all TDataSet components to TADODataSets and also we do not want to have to
generate these datasets twice (once to populate our TDataSet, and once to
populate a TADODataSet). Hopefully this is making sense?

Any suggestions would be greatly appreciated - I have a very limited
knowledge of ADO objects, sorry for my ignorance on this subject!

Thanks in advance,
Sinead


"Clayton Arends" < XXXX@XXXXX.COM >wrote in message
news:46cdb750$ XXXX@XXXXX.COM ...
>>Thank you for your help on this, at least now I know that it is possible
>>and can work from there.
>
>I believe the intent was to persuade you to not continue in this
>direction.
>
>Perhaps you can explain a little about the types of 'Rpt' and 'Database'
>and what functionality you are after. There might be other alternatives
>that you can pursue once a little more is known about your problem.
>
>- Clayton
>
>

 

Re:How to Convert TDataSet to TADO Recordset

Sinead Bunyan wrote:
Quote
However (!), we now are faced with using Crystal Reports 11, which
requires that data be passed to the reports as an ADO recordset.
TADODataSet allows you to populate it in code. It works like a
TClientDataSet when you do this. Could you write a routine that blasts
data from a TDataSet into a disconnected TADODataSet, and then pass the
RecordSet property of the TADODataSet to crystal reports?
H^2