和ADO还是BDE没有关系
如下响应TDataSetProvider的BeforeUpdateRecord事件
procedure TMultiTableUpdateServer.dspMultiJoinsBeforeUpdateRecord(
Sender: TObject;
SourceDS: TDataSet;
DeltaDS: TCustomClientDataSet;
UpdateKind: TUpdateKind;
var Applied: Boolean);
begin
if UpdateKind = ukModify then
begin
query2.Close;
query2.SQL.Clear;
query2.SQL.Add('update table1 set field1=:field1 where field2=:field2');
query2.Params.ParamByName('field1').Value := DeltaDS.fieldbyName('field1').Value;
query2.Params.ParamByName('field2').Value := DeltaDS.fieldbyName('field2').Value;
query2.ExecSQL;
//同理更新table2
query2.SQL.Clear;
query2.SQL.Add('update table2 set field3=:field3 where field4=:field4');
query2.ParamByName('field3').Value := DeltaDS.fieldbyName('field3').Value;
query2.ParamByName('field4').Value := DeltaDS.fieldbyName('field4').Value;
query2.ExecSQL;
end;
//删除和插入....
Applied := True;
end;