Page 1 of 1

Make copy of DataSet

Posted: Mon 06 Jun 2022 11:37
by Pavel95
Hello,
I am converting our old code with ado components to a new one using TUni..

I am having a problem with code like this:

AdoQuery.open();
AdoQuery.first();
AdoDataSet.Recordset := AdoQuery.Recordset;
AdoQuery.close();

It supossed to make a copy of AdoQuery data. Can i do something like that with TUniQuery?
I know that TUniQuery neither TDataSet have not RecordSet. But is there an elegant way to make a copy of data to another TDataSet or TUniQuery from TUniQuery?

Re: Make copy of DataSet

Posted: Fri 24 Jun 2022 17:00
by pavelpd
Hi Pavel,
Thanks for contacting us!

To copy data you can use the TCRBatchMove component that comes with our components.
More information you can find using the provided link:
https://www.devart.com/unidac/docs/deva ... chmove.htm

An example of using TCRBatchMove to copy data from TUniQuery to TVirtualTable:

Code: Select all

uses
  ... , CRBatchMove;
 
  ...
var
  CRBatchMove: TCRBatchMove;
  UniQuery: TUniQuery;
  VirtualTable: TVirtualTable;
  ...
begin
  ...
  CRBatchMove := TCRBatchMove.Create(nil);
  try
    CRBatchMove.Source := UniQuery;
    CRBatchMove.Destination := VirtualTable;
    CRBatchMove.Execute;
  finally
    CRBatchMove.Free;
  end;
  ...
end;