Change value BeforeUpdateExecute

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
b_wolf@gmx.net
Posts: 3
Joined: Mon 16 Jan 2006 23:41

Change value BeforeUpdateExecute

Post by b_wolf@gmx.net » 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?

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Tue 27 Feb 2007 13:56

The TCustomDADataSet.BeforeUpdateExecute event is not designed for such tasks.
Use the TDataSet.BeforePost event instead.

Post Reply