From Xojo Documentation
Commits an open transaction. This permanently saves changes to the database.
|DatabaseException||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:
You typically want to commit changes after ensuring there were no database errors:
Catch error As DatabaseException
MsgBox("Error: " + error.Message)