Deleting a Database File : Database File « Access « VBA / Excel / Access / Word






Deleting a Database File

 
Sub DeleteDbFile() 
    Dim strFile As String 

    strFile = CurrentProject.Path & "\mydb.mdb" 

    If Dir(strFile) <> "" Then 
        Kill strFile 
        MsgBox "The database file " & strFile & _ 
               " was successfully deleted." 
    End If 
End Sub 

 








Related examples in the same category

1.Prompting the User for the Database Path and Name
2.The VerifyLink Routine