Export (0) Print
Expand All

CDatabase::CommitTrans

Call this member function upon completing transactions.

BOOL CommitTrans( );

Nonzero if the updates were successfully committed; otherwise 0. If CommitTrans fails, the state of the data source is undefined. You must check the data to determine its state.

A transaction consists of a series of calls to the AddNew, Edit, Delete, and Update member functions of a CRecordset object that began with a call to the BeginTrans member function. CommitTrans commits the transaction. By default, updates are committed immediately; calling BeginTrans causes commitment of updates to be delayed until CommitTrans is called.

Until you call CommitTrans to end a transaction, you can call the Rollback member function to abort the transaction and leave the data source in its original state. To begin a new transaction, call BeginTrans again.

For more information about transactions, see the article Transaction (ODBC).

Header: afxdb.h

Show:
© 2014 Microsoft