I am trying to close a database and delete the mdb file. However, when I do this it does not delete the file because the file is still locked. Using DAO, is there a way to check to see if the mdb is still locked and wait until it is ok to delete it or is there a better way to do this?
If Not (Dbs Is Nothing) Then
Set Dbs = Nothing
sFileSpec = ProjectPath & "\" & ProjectName & ".mdb"
If Dir(sFileSpec) <> vbNullString Then Kill sFileSpec