![]() | Products |
| Home » Technical Support » DBISAM Technical Support » Frequently Asked Questions |
{ The following is an example of looping through the
TFields and copying data from one TDataset descendant
to another }
SourceDataSet:=TMyDataSet.Create(Nil);
with SourceDataSet do
begin
DatabaseName:='SQLServer';
TableName:='CUSTOMER';
Active:=True;
end;
DestDataSet:=TDBISAMTable.Create(Nil);
with DestDataSet do
begin
DatabaseName:='c:\testdb';
TableName:='customer';
Active:=True;
end;
SourceDataSet.First;
while not SourceDataSet.EOF do
begin
DestDataSet.Insert;
for I:=0 to SourceDataSet.FieldCount-1 do
DestDataSet.FieldByName(
SourceDataSet.Fields[I].FieldName).
Assign(SourceDataSet.Fields[I]);
DestDataSet.Post;
SourceDataSet.Next;
end;
SourceDataSet.Close;
DestDataSet.Close;
{ This example assumes that the source and
destination dataset field names will be the
same and it does not deal with copying the
structure or indexes, it simply copies the data }This web page was last updated on Wednesday, January 5, 2022 at 07:36 AM | Privacy Policy © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

