Public Sub CreateBackUp()
Dim strDBPath As String
Dim fso As Object
If MsgBox("Создать резервную копию БД ?", _
vbYesNo Or vbQuestion Or vbDefaultButton1, _
"Создание резервной копии") = vbYes Then
strDBPath = CurrentDb.Name
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile strDBPath, Left(strDBPath, Len(strDBPath) - 3) & "bak"
End If
Application.Quit acQuitSaveAll
End Sub
|