macro to permanently delete a database

2 posts / 0 new
Last post
avikerem's picture
avikerem
Offline
Joined: 04/07/2015 - 00:28
macro to permanently delete a database

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

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

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