Using the TOraQuery-TProvider-TClientDataSet model
Posted: Sun 28 Aug 2011 12:54
Using the TOraQuery-TProvider-TClientDataSet model, how do I update
Back to the server edit changes when the query is a multi table join?
In my old BDE application I used the TProvider BeforeUpdateRecord event
As the Delphi 7 help shows:
procedure TRemoteDataModule1.Provider1BeforeUpdateRecord(Sender: TObject; SourceDS: TDataSet; DeltaDS: TCustomClientDataSet; UpdateKind: TUpdateKind; var Applied Boolean);
begin
UpdateSQL1.DataSet := DeltaDS; { required for the automatic parameter substitution }
with UpdateSQL1.Query[UpdateKind] do
begin
{ Make sure the query has the correct DatabaseName and SessionName }
DatabaseName := (SourceDS as TDBDataSet).DatabaseName;
SessionName := (SourceDS as TDBDataSet).SessionName;
ParamByName('TimeOfUpdate').Value = Now;
end;
UpdateSQL1.Apply(UpdateKind); { now perform automatic substitutions }
Applied := True;
end;
Back to the server edit changes when the query is a multi table join?
In my old BDE application I used the TProvider BeforeUpdateRecord event
As the Delphi 7 help shows:
procedure TRemoteDataModule1.Provider1BeforeUpdateRecord(Sender: TObject; SourceDS: TDataSet; DeltaDS: TCustomClientDataSet; UpdateKind: TUpdateKind; var Applied Boolean);
begin
UpdateSQL1.DataSet := DeltaDS; { required for the automatic parameter substitution }
with UpdateSQL1.Query[UpdateKind] do
begin
{ Make sure the query has the correct DatabaseName and SessionName }
DatabaseName := (SourceDS as TDBDataSet).DatabaseName;
SessionName := (SourceDS as TDBDataSet).SessionName;
ParamByName('TimeOfUpdate').Value = Now;
end;
UpdateSQL1.Apply(UpdateKind); { now perform automatic substitutions }
Applied := True;
end;