Syntax
| recordsetobject.UpdateBatch [AffectRecords]
| |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Writes all pending batch updates to the underlying database.
The UpdateBatch method is called to save to the data source all of the pending changes and additions that have occurred in a Recordset object since the last update.
Clearly, the Recordset must support batch updating. When a Recordset is in batch updating mode, all of the changes and new additions are saved in a local cache until the BatchUpdate method is called. (The LockType property of the Recordset object must return the adLockBatchOptimistic constant which specifies that multiple users can modify the data and that all changes are locally cached.)
If all or part of the UpdateBatch fails, a warning is returned to the Errors Collection and an error is generated.
You can cancel a BatchUpdate by calling the CancelBatch method.
There is one optional parameter.
AffectEnum Constants
| |||||||||||||||||||
See Also
| ||||||||||||||||||||
Example
| If MsgBox("Batch Save All Changes", vbYesNo) = vbYes Then
objRecordset.UpdateBatch
MsgBox "All Changes Updated"
Else
objRecordset.CancelBatch
MsgBox "All Changes Cancelled"
End If
|