2,497
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.adoBAfterPost(DataSet: TDataSet);
var
i: integer;
fieldName: string;
begin
//定位记录集A对应记录,条件根据实际情况 coding
if not adoA.Locate('key字段',adoB['key字段'],[loCaseInsensitive]) then exit;
for i:=0 to adoB.FieldCount-1 do
begin
//如果有涉及自增、只读字段,需要 continue
fieldName := adoB.Fields[i].FieldName;
adoA[fieldName] := adoB[fieldName];
end;
//提交数据
adoA.Post;
end;