procedure TForm1.Table1AfterPost(DataSet: TDataSet);
begin
if Table1.Fields[2].Value=
Table1.Fields[0].Value+Table1.Fields[1].Value
then exit;
Table1.Edit;
Table1.Fields[2].Value:=
Table1.Fields[0].Value+Table1.Fields[1].Value;
Table1.Post;
//其中Value也可根据需要由AsInteger或AsString代替
end;
procedure qryTemp.OnCalcFields(#$%#$%$#%$#);
begin
with TADOQuery(Sender) do
FieldByName('Column3').AsInteger := StrToIntDef(FieldByName('Column2').AsString, 0) + StrToIntDef(FieldByName('Column1').AsString, 0);
end;