RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomProvider.ApplyUpdates Method (OleVariant, Integer, Integer)

Applies updates received as a delta packet.

Pascal
function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer): OleVariant; overload;
function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; overload;
C++
__fastcall OleVariant ApplyUpdates(const OleVariant Delta, int MaxErrors, int ErrorCount);
__fastcall OleVariant ApplyUpdates(const OleVariant Delta, int MaxErrors, int ErrorCount, OleVariant OwnerData);

Call ApplyUpdates to apply updates contained in a delta packet. ApplyUpdates generates a BeforeApplyUpdates event, applies the updates, and then generates an AfterApplyUpdates event. 

Specify the delta packet as the Delta parameter.  

Use the MaxErrors parameter to indicate the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is –1, the provider tries to apply all updates.  

ErrorCount returns the number of errors encountered during the update operation.  

The OwnerData parameter (if used) supplies custom information that is passed to the BeforeApplyUpdates event handler and which returns any information supplied by that event handler.  

ApplyUpdates returns a data packet (as an OleVariant) of updates that could not be applied to the database.

Note: ApplyUpdates always generates the BeforeApplyUpdates and AfterApplyUpdates events, even if you use the syntax that does not include an OwnerData parameter. In that case, the value of OwnerData is nil (Delphi) or NULL (C++) on entry to the BeforeApplyUpdates event handler and is discarded on exit from the AfterApplyUpdates event handler.
Warning: The provider can't detect when an update conflicts with another user's changes to a memo field. This situation will not contribute to the errors counted by ErrorCount.
 

 

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