SQLiteDatabase
Class SQLiteDatabase (inherits from Database)

PropertyDescription
AutoCommit As BooleanSpecifies whether an implicit Commit will occur after every SQL statement (INSERT, UPDATE). Setting this to true will ensure you don't lose any data, but it could significantly slow down your application. It is a far better idea to use transactions (refer to the example below).
DatabaseFile As FolderItemSpecifies the file that contains (or will contain) the SQLite database
EncryptionKey As StringSpecifies the password needed to connect to an encrypted database. This must be set before calling Connect().
ShortColumnNames As BooleanWhen False, the table name will prefix the column name in RecordSets (e.g. People.Name). When True, only the column name will be used (e.g. Name)


Method PrototypeDescription
Function AttachDatabase( file As FolderItem, dbName As String, p As String = "") As BooleanAllows you to attach another SQLite database file to the existing database connection.
Function CreateDataBaseFile() As BooleanCreates a new SQLite database. Returns True if the database was successfully created, False if it was not.
Sub Decrypt()Decrypts the connected database
Sub DetachDatabase( dbName As String )Disconnects a database file that was Attached to the current database connection
Sub Encrypt( password As String )Encrypts the database using the specified password
Function LastRowID() As IntegerReturns the ID of the last auto-generated key that was added to a table. This is useful after an INSERT command to get the ID of the row that was just added to the database.


Example:

// Using Transactions
myDB.SQLExecute("BEGIN TRANSACTION")

For i As Integer = 0 To 100
    myDB.SQLExecute("INSERT INTO myTable (Name) VALUES 'Bob'")
Next

myDB.Commit


// Opening an existing database file
Dim myDB As New SQLiteDatabase
myDB.DatabaseFile = GetFolderItem("test.sqlite")
If Not myDB.Connect Then
    Print "Error connect to database!"
End If