<div class="meta" robots="noindex">

</div>

Property

# Database_Class.Error

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `DatabaseException</api/exceptions/databaseexception>` as a replacement.

</div>

## Description

`True</api/language/true>` if an <span class="title-ref">Error</span> is returned from the database engine. See the values of the `ErrorCode</api/exceptions/databaseexception>` and `ErrorMessage</api/exceptions/databaseexception>` properties to learn the specifics of the <span class="title-ref">Error</span>.

## Notes

You should check the <span class="title-ref">Error</span> property after each database operation to see if there was an <span class="title-ref">Error</span>. If there is an <span class="title-ref">Error</span>, you can display or log the ErrorCode and ErrorMessage.

## Sample code

This code attempts to create an in-memory SQLite database and displays the <span class="title-ref">Error</span> if one occurred:

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

## Compatibility

All project types on all supported operating systems.
