Is there any way to modify data in dataset, before Commit(Apply)Updates initiated?
I try use BeforeUpdateExecute(). But all data modifications in this handler are not commited in current commit
Code: Select all
procedure TMainForm.BitBtnClick(Sender: TObject);
begin
MSQuery.SQL.Text := 'select * from emp';
MSQuery.Open;
MSQuery.Connection.StartTransaction;
MSQuery.Edit;
MSQuery.FieldByName('sal').AsFloat := 700;
MSQuery.Post;
MSQuery.Connection.Commit;
end;
procedure TMainForm.MSQueryBeforeUpdateExecute(Sender: TCustomMSDataSet;
StatementTypes: TStatementTypes; Params: TMSParams);
begin
if stUpdate in StatementTypes then
Params.ParamByName('sal').AsFloat := 900;
end;