RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomProvider.BeforeApplyUpdates Event

Occurs before the provider applies updates from a client dataset.

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

Write a BeforeApplyUpdates event handler to respond to custom information from a client dataset. BeforeApplyUpdates is part of the mechanism by which a provider and a client dataset communicate information about updates. 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 ApplyUpdates method is called, the following events occur: 

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

2.The provider receives a BeforeApplyUpdates event, where the OleVariant from the client dataset appears as the OwnerData parameter. The provider can respond to or change that information before applying the updates.  

3.If it is a dataset provider, the provider applies the updates, and receives an OnUpdateError event for any problem records. 

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

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

Note: If ApplyUpdates is called without the OwnerData parameter, the OwnerData parameter is nil (Delphi) or NULL (C++) on entry to the event handler and its value (on exit) is only passed to the AfterApplyUpdates event handler but not returned to the caller.
 

 

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