(Delphi XE4, Sybase Sql Server, TadoDataset)
In a database migration process, i need to transfert Records from a table T1 in Database DB1 to a Table T2 to database DB2.
I m using a TAdoDataSet to hold records from T1 and an other TAdoDataSet to hold a copy to be injected into a empty T2.
The copy is made succefully by doing this :
function CloneRecordset(const Data: _Recordset): _Recordset;
newRec := CoRecordset.Create as _Recordset;
stm := CoStream.Create;
newRec.Open(stm, EmptyParam, CursorTypeEnum(adOpenUnspecified),
Result := newRec;
Destination.Recordset := CloneRecordset(Source.Recordset);
The function copy effectively all record to dataset destination and i can display all record in a DBGrid.
The problem in that all records are not sent to the database.
All); do not change anything. the table T2 remains empty.
How to send prepared records in the "destination" TAdodataset to the database?
This Following code is functionnal but i m looking for a best way to do this, cause it takes time to insert record by record
while not(Destination.Eof) do
while not Source.Eof do
for i := 0 to Source.Fields.Count - 1 do
Thanks in advance.