ADO BeginTransComplete, CommitTransComplete 以及 RollbackTransComplete 事件

定义和用法

事件是某个具体的操作发生后被自动调用的子例程。

  • BeginTransComplete 事件在 BeginTrans 调用被完成后触发。
  • CommitTransComplete 事件在 CommitTrans 调用被完成后触发。
  • RollbackTransComplete 事件在 RollbackTrans 调用被完成后触发。

语法

BeginTransComplete translevel,objerror,status,objconn
CommitTransComplete objerror,status,objconn
RollbackTransComplete objerror,status,objconn 
参数 Description
translevel Long Value, containing the new transaction level of BeginTrans that triggered this event.
objerror

The Error Object that contains the errors that occurred.

Note:EventStatusEnum The value must be set to adStatusErrorsOccurred to create an Error object.

status Specify the status of the event execution. Take EventStatusEnum Status Value.
objconn The Connection Object that triggered this event.

EventStatusEnum Value

Constant Value Description
adStatusOK 1 The operation that triggered this event was successful.
adStatusErrorsOccurred 2 The operation that triggered this event failed.
adStatusCantDeny 3 Cannot cancel the suspended operation.
adStatusCancel 4 Cancel the operation that caused the event.
adStatusUnwantedEvent 5 Ban the subsequent notifications before the event method execution ends.