iOSSQLiteDatabase.Connect

From Xojo Documentation

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

iOSSQLiteDatabase.Connect() As Boolean

Supported on Mobile(iOS).

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

To create an in-memory SQLite database, call Connect without having previously specified a DatabaseFile.

Sample Code

Connect to an existing database:

Var db As New iOSSQLiteDatabase

Var dbFile As FolderItem
dbFile = SpecialFolder.Documents.Child("MyDB.sqlite")

If dbFile.Exists Then
db.DatabaseFile = dbFile
If db.Connect Then
// proceed with database operations here...
Else
Var err As Text = "Could not open the database."
End If
End If