CommitTrans Method

Commits the transaction, making all changes made during the transaction permanent.

Syntax

Object.CommitTrans()

Arguments - Object: Required. Always the name of ADODB Connection object.

Remarks

The following example illustrates the use of the CommitTrans method.

Example 1:


'Create ADODB.Connection Object
Dim ConnObj   ' Create a variable.
Set ConnObj = CreateObject("ADODB.Connection")
ConnObj.Open("ConnectionString") 'Creates DB Connection by Using Connection String

ConnObj.BeginTrans()
'Execute multiple queries based on requirement
ConnObj.CommitTrans() 'Commits the transaction
ConnObj.Close()
Set ConnObj = Nothing