Delete Database

2 posts / 0 new
Last post
chdarc
Offline
Joined: 06/13/2016 - 14:53
Delete Database

Hello, 
I'm having a little problem when trying to delete a database using Script. Everytime the code run it gives me an error saying: "Unable to delete." Not sure why that is, so any help would be great. 
Code I have is: 
Client.DeleteDatabase("SumbyJrnl.IMD")

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Chris,

More than likely it is because your database is still open.  Before you do the delete line add the following"

Client.CloseDatabase "SumbyJrnl.IMD"

Also for the delete database I am not sure if you need the brackets or you can just have it within the double quotes.

Also for closing the database in your functions when you open the database in a Set db = client.opendatabase("SumbyJrnl.IMD") and you have the line Set db = nothing add the line db.close and that will make sure that the database is closed.

Good luck.

Brian