macro to permanently delete a database
avikerem
Forums
Hi Brian - how do you permanently delete a database in a macro? iIE - is there a parameter to client.deletedatabase or some other trick to permanently remove the database . THANKS
Hi jmax6,
Hi jmax6,
My guess it that you haven't set the db variable to nothing. This is one instance if you don't set the db variable to nothing then IDEA thinks the database is still in use even if the script is complete and you won't be able to delete or rename the file.
Instead of Set dbName = nothing it should be Set db = nothing
I think that should fix your problem.
Hi Avi,
Hi Avi,
Actuall that is it:
Client.DeleteDatabase "Sample-DBASE.IMD"
You need to make sure the database is closed before deleting just like in IDEA so usually I have the:
Client.CloseAll
Client.CloseDatabase "Sample-DBASE.IMD"
command before I use the delete database, that way I know the database is closed. You also have to make sure that if you have used it in an open function like:
Set db = client.OpenDatabase("Sample-DBASE.IMD")
that you have the
Set db = Nothing
before trying to delete it or else it won't work.
Hope that helps out.
Brian