Cancel Method
CancelUpdate Property
LockType Property
Update Method
UpdateBatch Method
METHOD: Recordset::CancelBatch
recordsetobject.
CancelBatch
AffectRecords
The
CancelBatch
method is called to cancel a pending batch update. The
Recordset
must be in batch update mode, otherwise an error will occur.
Since you cannot predict what the current record will be after calling this property, you will need to move to a known record. For example, you could call the
MoveFirst
method, after the call to the
CancelBatch
method is completed.
If the attempt to cancel the pending updates fails, the provider does not halt execution, but it will send warnings to the
Errors Collection
. Therefore you should always check the
Errors Collection
after the call to the
CancelBatch
method is completed.
There is one optional parameter.
The optional
AffectRecords
parameter is one of the
AffectEnum
constants that specifies which records are to be affected.
AffectEnum Constants
Constant
Value
Description
adAffectAll
3
Cancels all pending updates including those hidden by a filter
adAffectAllChapters
4
Cancels all pending updates in all child (chapter) recordsets
adAffectCurrent
1
Cancels only the current record
adAffectGroup
2
Cancels updates only on records that passed through the filter in effect
Code (VBScript):
If MsgBox("Batch Save All Changes", vbYesNo) = vbYes Then
objRecordset.UpdateBatch
MsgBox "All Changes Updated"
Else
objRecordset.
CancelBatch
MsgBox "All Changes Cancelled"
End If
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information