Database.Connect

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

Database.Connect()

New in 2019r2

Supported for all project types and targets.

Connects to the database so that you can begin using it.


Method

Database.Connect() As Boolean

Supported for all project types and targets.

Connects to the database so that you can begin using it. Before proceeding with database operations, test to be sure that Connect returns True.

Notes

fa-exclamation-circle-32.png
A DatabaseException will be raised if the connection could not be made.

Sample Code

This example connects to the database object in the variable db:

Try
db.Connect
MessageBox("Connected!")
Catch error As DatabaseException
MessageBox("Error connecting to the database: " + error.Message)
End Try