SQLiteDatabase.RemoveDatabase
From Xojo Documentation
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site! |
Method
Removes the passed database that was previously added with AddDatabase.
Example
This example removes as previously added database:
Var DBFile As New FolderItem("MyDB.sqlite")
Try
currentDB.AddDatabase(attachDBFile, "locations")
MessageBox("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.RemoveDatabase("locations")
Catch error As IOException
MessageBox("The database could not be added.")
Catch error As DatabaseException
MessageBox("The database could not be removed."
End Try
Try
currentDB.AddDatabase(attachDBFile, "locations")
MessageBox("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.RemoveDatabase("locations")
Catch error As IOException
MessageBox("The database could not be added.")
Catch error As DatabaseException
MessageBox("The database could not be removed."
End Try