It seems strange that if you close the database as soon as you are done with it then sometime goes by you attempt to remove it and fails says to me the database connection is still open or (not knowing your environment) another process has the database open
While the MDB is open there will be a lock file present, until it goes away you cannot remove the MDB.
Before you attempt to remove the MDB try the following. When trying the following out make sure you do not have MS-Access application open.
When the message box appears traverse to the folder with abc.mdb and see if abc lock file exists which is the lock file. If the lock file exists then the delete will fail while if the lock file is not there you can delete the file.
One possible solution would be to go into a loop to remove the file. The intent is to allow time for the file to close. When trying the following out make sure you do not have MS-Access application open.
Now call it as follows
''' Remove MS-Access database
''' <param name="FileName">Database to remove</param>
''' <param name="WaitTime">Sleep time</param>
''' <param name="Loops">How many attempts to try</param>
Function RemoveAccessDatabase( _
ByVal FileName As String, _
ByVal WaitTime As Integer, _
ByVal Loops As Integer) As Boolean
Dim Success As Boolean = False
Dim LockFile As String = IO.Path.ChangeExtension(FileName, "ldb")
For Counter As Integer = 0 To Loops
If IO.File.Exists(LockFile) Then
Success = True
Let's say that fails, increase the second param in 100 increments until it does work.
RemoveAccessDatabase("abc.mdb", 100, 5)
On a different topic you need to avoid Go To statements as they can cause more problems then they are worth. Learn how to code without them.