iOSSQLiteDatabase.CreateDatabaseFile

From Xojo Documentation

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

iOSSQLiteDatabase.CreateDatabaseFile() As Boolean

Supported on Mobile(iOS).

Creates a database file. Returns True if the database was successfully created.

Notes

You are automatically connected if CreateDatabase returns True, so you do not need to also call Connect.

Sample Code

Create a New iOSSQLiteDatabase:

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

Var db As New iOSSQLiteDatabase
db.DatabaseFile = dbFile
If db.CreateDatabaseFile Then
' proceed with database operations here...
Else
Var err As Text = "Database could not be created."
End If