Ends the current transaction and saves the changes.
Syntax
VOID CommitTrans (LONG lOptions=-1);
Parameters
Type | Example | Description |
LONG | lOptions=-1 | Optional. In a Microsoft Jet workspace, specify dbForceOSFlush to force the database engine to immediately flush all updates to disk, instead of caching them temporarily. |
Usage
#include <afxole.h>
#include <dbdao.h>
...
CdbWorkspace ws;
BOOL error;
... // Create a workspace, etc.
ws.BeginTrans(); // Start working.
... // Make some changes.
if (error)
ws.Rollback(); // Reject changes
else // Accept changes
ws.CommitTrans(dbForceOSFlush);
ws.Close(); // Close the workspace