Database.Commit

From Xojo Documentation
Jump to: navigation, search
Method

Database.Commit()

Commits an open transaction. This permanently saves changes to the database.

Notes

You have to have an open transaction to be able to use Commit. On SQLite (and other databases), you can start a transaction with this command:

 BEGIN TRANSACTION

It can be sent using SQLExecute:

DB.SQLExecute("BEGIN TRANSACTION")

Example

You typically want to Commit changes after ensuring there were no database errors:

// Prior DB code has run

If Not DB.Error Then
DB.Commit
Else
MsgBox("Error: " + DB.ErrorMessage)
DB.Rollback
End If

See Also

Database.Close, Database.Rollback

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About