Delphi - 复制在 DBGrid 上选择的记录并将其插入到另一个 ADO table
Delphi - Copying a record selected on a DBGrid and inserting it into another ADO table
所以我试图将某个选定的记录/活动记录从 DBGrid(当然通过 TDataSource 组件连接到 ADO Table)复制到另一个 ADO Table 但是我不确定如何处理这个问题?
所涉及的2个数据库完全相同,只是名称和用途不同。
在此先感谢您的帮助!
亲切的问候
PrimeBeat
procedure TfrmEntry.Copy(tblSource: TADOTable; tblDest: TADOTable);
var
i:integer;
begin
tblDest.Open;
tblDest.Append;
tblSource.Open;
for i := 0 to tblSource.FieldCount -1 do
begin
tblDest.Fields[i].AsString := tblSource.Fields[i].AsString;
end;
tblDest.Post;
end;
所以我试图将某个选定的记录/活动记录从 DBGrid(当然通过 TDataSource 组件连接到 ADO Table)复制到另一个 ADO Table 但是我不确定如何处理这个问题?
所涉及的2个数据库完全相同,只是名称和用途不同。
在此先感谢您的帮助!
亲切的问候 PrimeBeat
procedure TfrmEntry.Copy(tblSource: TADOTable; tblDest: TADOTable);
var
i:integer;
begin
tblDest.Open;
tblDest.Append;
tblSource.Open;
for i := 0 to tblSource.FieldCount -1 do
begin
tblDest.Fields[i].AsString := tblSource.Fields[i].AsString;
end;
tblDest.Post;
end;