Page 1 of 1

Change value BeforeUpdateExecute

Posted: Tue 27 Feb 2007 11:49
Hi,

I want to alter some field-values before the update of the query occurs.

Code: Select all

procedure TDataModule1.q_anredeBeforeUpdateExecute(
  Sender: TCustomMSDataSet; StatementTypes: TStatementTypes;
  Params: TMSParams);
begin
  Sender.FieldByName('myfield').Text := 'test';
end;
But this doesn't work. Is this the correct way to solve this or how is this done?

Posted: Tue 27 Feb 2007 13:56
by Jackson
The TCustomDADataSet.BeforeUpdateExecute event is not designed for such tasks.
Use the TDataSet.BeforePost event instead.