Purpose
Commits a transaction on a data source.
Note
This method is only available to data sources that support transactions. Commit is not a valid operation for connections that have AutoCommit turned on.
Syntax
DBConnection.Commit
Example
Sub Main()
Dim cnct as DBConnection
cnct.OpenConnection("MyDSN") 'Open the data source "MyDSN"
cnct.AutoCommit = SQL_AUTOCOMMIT_OFF
'Begin the transaction
' Create statements and execute SQL...
' ...
If (UserClickedCancel = TRUE)
cnct.Rollback 'Rollback changes
Else
cnct.Commit 'Commit changes
End if
cnct.CloseConnection 'Close the connection
End Sub
|