dbCommitTransaction()

Database function for closing a transaction, changes are implemented.

Synopsis

int dbCommitTransaction(dbConnection connection);

Parameters

Parameter Meaning
connection Connection reference provided by dbOpenConnection()

Return Value

The return value is an error code; 0 indicates the operation has been performed successfully. For other values dbGetError() can be used to obtain detailed error information.

Errors

An error is returned if an invalid connection is passed, if there has been no earlier dbBeginTransaction() function or if the data source does not support transactions.

Description

dbCommitTransaction() or dbRollbackTransaction() is called to close a transaction. With dbCommitTransaction(), all changes made to the data source during the period of the transaction (i.e. since the dbBeginTransaction() call) are implemented and can be seen. Depending on the data source, a new transaction can be started implicitly (i.e. without the dbBeginTransaction() call).

Example

see dbBeginTransaction()

Assignment

ADO and Qt, Database functions

Availability

CTRL