RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomClientDataSet.SavePoint Property

Represents the current state of edits when logging changes.

Pascal
property SavePoint: Integer;
C++
__property int SavePoint;

Use SavePoint to save and later revert to an editing state. SavePoint is an integer that represents the current state of the change log. To use SavePoint to roll back the changes in the change log to an earlier state, set SavePoint to the value it had before the changes that should be rolled back. 

Thus, when the client dataset is in a state you may want to return to, assign SavePoint to a variable:

BeforeChanges := ClientDataSet1.SavePoint;

 

BeforeChanges = ClientDataSet->SavePoint;

Later, to roll back all edits that were made since that point, assign the variable to SavePoint:

ClientDataSet1.SavePoint := BeforeChanges;

 

ClientDataSet->SavePoint = BeforeChanges;

Warning: Client datasets can't return to a SavePoint once the change log has been backed out to a prior state. This includes undoing changes by setting SavePoint to a previously saved value, backing out too many changes using the RevertRecord method, or clearing the change log using CancelUpdates. Trying to set SavePoint to a state that is no longer available in the change log raises an exception.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!