Page 1 of 1

BeforeInsertExecute BeforeDeleteExecute ?

Posted: Mon 18 Oct 2010 14:29
by rept
The event BeforeUpdateExecute exists and it allows me to set parameters, which is great.

However I need to do the same thing for insert and delete but those events don't seem to exist???

How can I fill in some parameters with SQLInsert and SQLDelete? Most parameters are taken from the dataset, such as the ID, but there are some parameters that I need to fill in myself (for example the user ID).

Posted: Wed 20 Oct 2010 08:28
by AndreyZ
Hello,

The BeforeUpdateExecute event occurs before executing insert, delete, update, lock and refresh operations.
Here is an example of using it:

Code: Select all

procedure TMainForm.MSQueryBeforeUpdateExecute(Sender: TCustomMSDataSet;
  StatementTypes: TStatementTypes; Params: TMSParams);
begin
  if stInsert in StatementTypes then
    //your code
  else
  if stDelete in StatementTypes then
    //your code
  else
  if stUpdate in StatementTypes then
    //your code
end;

Posted: Thu 21 Oct 2010 22:26
by rept
Great, works perfect!

Posted: Fri 22 Oct 2010 05:32
by AndreyZ
Feel free to contact us if you have any further questions about SDAC.