Database.CommitTransaction
From Xojo Documentation
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site! |
Method
Commits an open transaction. This permanently saves changes to the database.
Notes
A DatabaseException will be raised if the transaction could not be committed.
You have to have an open transaction to be able to use CommitTransation. Use BeginTransaction to begin a transaction:
DB.BeginTransaction
Sample Code
You typically want to commit changes after ensuring there were no database errors:
// Prior DB code has run
Try
DB.CommitTransaction
Catch error As DatabaseException
MessageBox("Error: " + error.Message)
DB.RollbackTransaction
End Try
Try
DB.CommitTransaction
Catch error As DatabaseException
MessageBox("Error: " + error.Message)
DB.RollbackTransaction
End Try