ADO » Connection » BeginTrans

long = connectionobject.BeginTrans

Begins a new transaction and returns a long value indicating the number of nested transactions.

The BeginTrans method begins a new transaction. For example, a transaction could be a monetary transfer between two accounts. First, you would withdraw money from one account. Second, you would deposit the money into another account. Both actions must be correctly accomplished for such a transaction to be considered completed.
This method can also be used to return a long value that is the level of nested transactions. A nested transaction is simply a transaction that occurs within a transaction. A top level transaction has a return value of 1 (one). Each additional level increments by one (the second level returns a 2, etc.).
This method is only used to start a new transaction. Saving or cancelling a transaction requires the use of the CommitTrans and RollbackTrans methods.
Not all providers allow transactions. You can search the Properties Collection to see if the Transaction DDL property occurs as part of the collection.



See Also: