SQLiteDatabase.DatabaseFile

From Xojo Documentation

Property (As FolderItem )
aSQLiteDatabase.DatabaseFile = newFolderItemValue
or
FolderItemValue = aSQLiteDatabase.DatabaseFile

Supported for all project types and targets.

Specifies the FolderItem for the SQLite database file. If DatabaseFile is Nil, calling the Connect method creates an in-memory database.

Example

This code connect to an existing SQLite database:

Var db As New SQLiteDatabase

Var dbFile As FolderItem = FolderItem.ShowOpenFileDialog("")

If dbFile <> Nil And dbFile.Exists Then
db.DatabaseFile = dbFile

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

This code creates an in-memory database that you can use for storing temporary data:

Var db As New SQLiteDatabase

Try
db.Connect
// Create tables and add data as necessary.
Catch error As DatabaseException
MessageBox("DB Connection Error: " + error.Message)
End Try