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

</div>

Method

# SQLiteDatabase.DetachDatabase

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

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `SQLiteDatabase.RemoveDatabase<sqlitedatabase.removedatabase>` as a replacement.

</div>

## Description

Detaches the passed database that was previously attached with AttachDatabase.

## Sample code

This example detaches as previously attached database:

``` xojo
Dim attachDBFile As New FolderItem("AttachDB.sqlite")

If currentDB.AttachDatabase(attachDBFile, "locations") Then
  MsgBox("Database attached.")
  ' Queries against the attached database would be prefixed with "locations", such as
  ' SELECT City FROM locations.Addresses WHERE ST = 'TX'

  ' When you are finished, you can detach the database
  currentDB.DetachDatabase("locations")
End If
```

## Compatibility

All project types on all supported operating systems.
