CdbRecordset::CancelUpdate Method

Cancels any pending updates for the Recordset object.

Syntax

VOIDCancelUpdate(short sType = dbUpdateRegular);

Parameters

Type Example Description
SHORT sType = dbUpdateRegular Optional. A constant indicating the type of update (ODBCDirect workspaces only).

The following are valid values for Type.

Constant Description
dbUpdateRegular (Default) Pending changes aren’t cached and are written to disk immediately.
dbUpdateBatch All pending changes in the update cache are written to disk.

Remarks

You can use the CancelUpdate method to cancel any pending updates resulting from an Edit or AddNew operation.

Usage

#include <afxole.h>
#include <dbdao.h>
...
BOOL            bOK = TRUE;
CdbRecordset      rst;
...
rst.AddNew();            // Begin to add a record
if (bOK)                  // Is it OK to add a record?
   rst.Update();         // yes: Complete the addition
else                     // no: Abort the addition
   rst.CancelUpdate(dbUpdateRegular);