The cancelBatch method of the Recordset class cancels a pending batch update. cancelBatch has the following signatures:
cancelBatch()
cancelBatch(int affectRecords)
Use cancelBatch to cancel any pending updates in a recordset in batch update mode. If the Recordset is in immediate update mode, calling cancelBatch without AdoEnums.Affect.CURRENT generates an error.
If you are editing the current record or are adding a new record when you call cancelBatch, ADO first calls cancelUpdate to cancel any cached changes; after that, all pending changes in the recordset are canceled.
It's possible that the current record will be indeterminable after a cancelBatch call, especially if you were in the process of adding a new record. For this reason, it is prudent to set the current record position to a known location in the recordset after the cancelBatch call. For example, call moveFirst.
If the attempt to cancel the pending updates fails because of a conflict with the underlying data (for example, a record has been deleted by another user), the provider returns warnings to the Errors object but does not halt program execution. A runtime error occurs only if there are conflicts on all the requested records. Use AdoEnums.FilterGroup.AFFECTEDRECORDS and AdoEnums.RecordStatus to locate records with conflicts.
Cancels a pending batch update.
public void cancelBatch();
Cancels a pending batch update.
public void cancelBatch(int affectRecords);
affectRecords | An Ado.Enums.Affect value that determines how many records the cancelBatch method will affect. |