Share via


CDatabase::Rollback

BOOLRollback();

Return Value

Nonzero if the transaction was successfully reversed; otherwise 0. If a Rollback call fails, the data source and transaction states are undefined. If Rollback returns 0, you must check the data source to determine its state.

Remarks

Call this member function to reverse the changes made during a transaction. All CRecordsetAddNew, Edit, Delete, and Update calls executed since the last BeginTrans are rolled back to the state that existed at the time of that call.

After a call to Rollback, the transaction is over, and you must call BeginTrans again for another transaction. The record that was current before you called BeginTrans becomes the current record again after Rollback.

After a rollback, the record that was current before the rollback remains current. For details about the state of the recordset and the data source after a rollback, see the article in Visual C++ Programmer's Guide.

Example

See the article in Visual C++ Programmer's Guide.

CDatabase OverviewClass MembersHierarchy Chart

See Also   CDatabase::BeginTrans, CDatabase::CommitTrans