RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataSetProvider.DoBeforeExecute Method

Generates a BeforeExecute event.

Pascal
procedure DoBeforeExecute(const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); override;
C++
virtual __fastcall DoBeforeExecute(const BSTR CommandText, OleVariant Params, OleVariant OwnerData);

The Execute method calls DoBeforeExecute to generate the BeforeExecute event before it executes CommandText or executes an associated query or stored procedure. 

CommandText is either an optional SQL statement that replaces the SQL of an associated query, or the name of a stored procedure that replaces the associated stored procedure. If Options includes poAllowCommandText, DoBeforeExecute sends CommandText to the associated dataset so that it can execute the provided statement instead of its query or stored procedure. 

Params contains any parameter values that should be applied to CommandText or to the query or stored procedure before execution. DoBeforeExecute assigns these parameter values to the dataset (if appropriate). 

OwnerData supplies custom information to the BeforeExecute event handler. The event handler can change this value. The returned value is then passed to an AfterExecute event handler and then returned to the caller of the Execute method. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!