SQLiteDatabase.CreateDatabaseFile

From Xojo Documentation

Method

SQLiteDatabase.CreateDatabaseFile() As Boolean

Supported for all project types and targets.

Creates a new SQLiteDatabase. It uses the DatabaseFile property as the FolderItem for the database to create.

Notes

If the database already exists, this function works like Database.Connect. CreateDatabaseFile returns True if the new database was created successfully or an existing database was opened successfully. Otherwise it returns False.

Example

This example creates a new database:

Dim f As FolderItem
f = New FolderItem("MyDB.sqlite")

Dim db As New SQLiteDatabase
db.DatabaseFile = f
If db.CreateDatabaseFile Then
// proceed with database operations...
Else
MsgBox("Database not created. Error: " + db.ErrorMessage)
End If