Partager via


BeginTransComplete, CommitTransComplete, and RollbackTransComplete Events

These events will be called after the associated operation on the Connection object finishes executing.

  • BeginTransComplete is called after the BeginTrans operation.
  • CommitTransComplete is called after the CommitTrans operation.
  • RollbackTransComplete is called after the RollbackTrans operation.

Syntax

BeginTransComplete TransactionLevel, pError, adStatus, pConnection
CommitTransComplete pError, adStatus, pConnection
RollbackTransComplete pError, adStatus, pConnection

Parameters

  • TransactionLevel
    A Long value that contains the new transaction level of the BeginTrans that caused this event.

  • pError
    An Error object. It describes the error that occurred if the value of EventStatusEnum is adStatusErrorsOccurred; otherwise it is not set.

  • adStatus
    An EventStatusEnum status value. When any of these events is called, this parameter is set to adStatusOK if the operation that caused the event was successful, or to adStatusErrorsOccurred if the operation failed.

    These events can prevent subsequent notifications by setting this parameter to adStatusUnwantedEvent before the event returns.

  • pConnection
    The Connection object for which this event occurred.

Remarks

In Visual C++, multiple Connections can share the same event handling method. The method uses the returned Connection object to determine which object caused the event.

If the Attributes property is set to adXactCommitRetaining or adXactAbortRetaining, a new transaction starts after committing or rolling back a transaction. Use the BeginTransComplete event to ignore all but the first transaction start event.

See Also

Visual C++ Example | Visual J++ Example | Visual Basic Example

ADO Event Handler Summary | BeginTrans, CommitTrans, and RollbackTrans Methods

Applies To: Connection Object