Delete Database
chdarc
Forums
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")
Hi Chris,
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