SQLiteDatabase.Timeout

From Xojo Documentation

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

Property (As Double )
aSQLiteDatabase.Timeout = newDoubleValue
or
DoubleValue = aSQLiteDatabase.Timeout

Supported for all project types and targets.

The maximum number of seconds that an operation may wait before a lock is cleared (if any). The default is 10.

Notes

If an operation has to wait longer than this amount of seconds then the operation will fail (with a suitable SQL error).

If the value is less than or equal to 0 then all busy handlers will be disabled and the operation will wait indefinitely.

This value can be changed at any time.

Example

This example sets the Timeout to 30 seconds.

Var dbFile As New FolderItem("MyDB.sqlite")

Var db As New SQLiteDatabase
db.DatabaseFile = dbFile

db.Timeout = 30

Try
db.Connect
// Key was correct; DB is connected
MessageBox("Connected to database.")
Catch error As DatabaseException
MessageBox("Connection error: " + error.Message)
End Try