From Xojo Documentation

Revision as of 21:12, 23 January 2019 by PLefebvre (talk | contribs)
Read-Only Property (As Integer )
IntegerValue = aDatabase.ErrorCode

Supported for all project types and targets.

The error code returned from the database. Error codes and error messages are different for each database.


You should check the Error property after each database operation to see if there was an error. If there is an error, you can display or log the ErrorCode and ErrorMessage.

Sample Code

This code attempts to create an in-memory SQLite database and displays the error if one occurred:

Dim db As New SQLiteDatabase
If db.Connect Then
// Connected to in-memory database
If db.Error Then
MsgBox("Error: " + Str(db.ErrorCode) + " - " + db.ErrorMessage)
End If
End If