procedure TForm1.Button1Click(Sender: TObject);
var
FieldListName:TStringList;
i:Integer;
begin
FieldListName:=TStringList.Create;
with Table1 do begin
Close;
DatabaseName:='路径';
TableName:='文件名';
Open;
GetFieldNames(FieldListName);
end;
with Table2 do begin
Close;
DatabaseName:='路径';
TableName:='文件名';
Open;
while not Table1.EOF do begin
Append;
for i:=0 to FieldListName.Count-1 do begin
FindField(FieldListName).AsString:=Table1.FindField(FieldListName).AsString;
end;
Post;
Table1.Next;
end;
end;
Table1.Close;
Table2.Close;
end;