delete database

spinkung

Registered User.
Local time
Today, 11:30
Joined
Dec 4, 2006
Messages
267
Hi,

i'm trying to delete a database using vba??

i have run some code to compact the db (which creates a new version). i then want to delete the old version and rename the new one.

how do i go about deleting a db using vba?

thanks
spin
 
Well, the code I use is:
Code:
Public Function CompactDb()

Dim strDbNameOld As String
Dim strDBNameNew As String

strDbNameOld = "YourPathAndNameToTheFileYouWantToCompact"

        DBEngine.CompactDatabase strDBNameOld, strDBNameNew
        Kill strDBNameOld
        Name strDBNameNew As strDBNameOld

End Function

So Kill would be it.
 
spot on. thank you.
 

Users who are viewing this thread

Back
Top Bottom