RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomProvider.BeforeExecute Event

Occurs before the provider passes an execute command to its dataset.

Pascal
property BeforeExecute: TRemoteEvent;
C++
__property TRemoteEvent BeforeExecute;

Write a BeforeExecute event handler to respond to custom information from a client dataset before executing a query or stored procedure. Any parameter values supplied by the client dataset with the Execute command are applied before this event. 

BeforeExecute is part of the mechanism by which a provider and a client dataset communicate information when executing queries or stored procedures that do not return cursors. When the provider is part of a stateless application server, this mechanism allows the provider and the client dataset to communicate persistent state information. 

When the client dataset's Execute method is called, the following events occur: 

1.The client dataset receives a BeforeExecute event, where it can encode custom information into an OleVariant

2.The provider receives a BeforeExecute event, where the OleVariant from the client dataset appears as the OwnerData parameter. The provider can respond to or change that information before passing the execute command on to its dataset.  

3.The provider dispatches its Execute method to execute a query or stored procedure. 

4.The provider receives an AfterExecute event, where it can encode custom information into its OwnerData parameter or respond to information from the BeforeExecute event handler. 

5.The client dataset receives an AfterExecute event, where it can respond to the custom information returned by the provider in its AfterExecute event handler. 

 

Execute 

AS_Execute 

Execute 

DataSet 

BeforeExecute

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