Database.Close

From Xojo Documentation
Jump to: navigation, search
Method

Database.Close()

Closes or disconnects the database.

Notes

Calling Close does not issue a Commit, but some databases will automatically Commit changes in a transaction when you Close the connection and some database will automatically Rollback changes in a transaction when the connection is closed. Refer to the documentation for your database to check what its behavior is.

For desktop applications, you will often Connect to the database when the app starts and Close it when the app quits.

For web applications, you usually Connect to the database when the Session starts and Close it when the Session quits.

Example

This code in the App.Close event handler closes a previously connected database:

DB.Close // DB is a property on App
Personal tools
Namespaces

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