Question. When we use a procedure for compacting a database, is there any untrappable error that could occur during this call:
DBEngine.CompactDatabase sDBName, sBackup

which would then allow
Kill sDBName
to occur thus removing the database from the system?

The entire procedure is below:

Sub CompactDatabase(sDBName As String, sBackup As String)
on error goto errtrap
db.Close

'Check to see if the tempory backup exists
If Len(Dir$(sBackup)) > 0 Then 'Backup exists

Kill sBackup 'Delete it

End If

'Compact the database to the tempory one
DBEngine.CompactDatabase sDBName, sBackup

'Delete the current one
Kill sDBName

'Compact the backup to the actual database
DBEngine.CompactDatabase sBackup, sDBName

'And remove the backup database
Kill sBackup

OpenDB (App.Path & "\demo.mdb")
exit sub
errtrap:
msgbox "there is an error"
End Sub