Code:
Private Sub Command0_Click()
Dim bckup As FileSystemObject
On Error GoTo Unsuccessful
Dim strBckupName As String
strBckupName = "primer1_Backup " & Format(Date, "mm.dd.yyyy") & " - " & Format(Time, "hhmmss") & ".accdb"
Set bckup = New FileSystemObject
bckup.CopyFile Application.CurrentProject.FullName, Application.CurrentProject.Path & "\Downloads\" & strBckupName, True
Set bckup = Nothing
Beep
MsgBox "Backup was successful and saved @ " & Chr(13) & Chr(13) & Application.CurrentProject.Path & Chr(13) & Chr(13) & "The backup file name is " & Chr(13) & Chr(13) & strBckupName, vbInformation, "Backup Completed"
End
Unsuccessful:
MsgBox "Backup unsuccessful. Check:" & Chr(13) & Chr(13) & "- The disk you are saving to is not full" & Chr(13) & Chr(13) & "AND" & Chr(13) & Chr(13) & "- That a 'backups' folder has been created in the directory of the active database", vbExclamation, "Backup Unsuccessful"
End Sub
Private Sub Command0_Click()
Dim bckup As FileSystemObject
On Error GoTo Unsuccessful
Dim strBckupName As String
strBckupName = "primer1_Backup " & Format(Date, "mm.dd.yyyy") & " - " & Format(Time, "hhmmss") & ".accdb"
Set bckup = New FileSystemObject
bckup.CopyFile Application.CurrentProject.FullName, Application.CurrentProject.Path & "\Downloads\" & strBckupName, True
Set bckup = Nothing
Beep
MsgBox "Backup was successful and saved @ " & Chr(13) & Chr(13) & Application.CurrentProject.Path & Chr(13) & Chr(13) & "The backup file name is " & Chr(13) & Chr(13) & strBckupName, vbInformation, "Backup Completed"
End
Unsuccessful:
MsgBox "Backup unsuccessful. Check:" & Chr(13) & Chr(13) & "- The disk you are saving to is not full" & Chr(13) & Chr(13) & "AND" & Chr(13) & Chr(13) & "- That a 'backups' folder has been created in the directory of the active database", vbExclamation, "Backup Unsuccessful"
End Sub
hteo bih da razdvojim bazu i da mi uradi backup i kompresuje u rar format a da rar fajl bude ovog formata
Code:
"primer1_Backup " & Format(Date, "mm.dd.yyyy") & " - " & Format(Time, "hhmmss") & ".accdb"
"primer1_Backup " & Format(Date, "mm.dd.yyyy") & " - " & Format(Time, "hhmmss") & ".accdb"
Nemam pojma šta da stavim u potpis!