Description

This method will abort the actions performed within this McDBTransaction and return database objects to their states in the enclosing Level. If this McDBTransaction is not nested (i.e. is at Level 1), the relevant database(s) are left unchanged. Any database objects locked because of actions performed in this McDBTransaction Level are unlocked. If this McDBTransaction is nested, this method will only undo the action(s) taken in the current Level, and enclosing Level(s) may still be Committed or Aborted independently.

Return Type

None  

Syntax

object.Abort

The Abort Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBTransaction.

Remarks

Aborting a transaction will invalidate objects that only exist in the context of the transaction (Level) being aborted, and any attempt to use a an issued interface for such a stale object will fail and return OLE_E_BLANK (Uninitialized Object, Code &H80040007). However, interfaces to objects which existed in a database, but are loaded during a transaction that is aborted remain valid, but their objects exist at the higher transaction Level.

Exceptions

Error Value Description
CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT &H80004024 This McDBTransaction is not the McDBDatabases.ActiveTransaction. A McDBTransaction must first be the active one, before it can be committed or aborted.
OLE_E_CANT_BINDTOSOURCE &H8004000A This McDBTransaction is not running. That is, its Level is 0 (immediate commit).