Met onderstaande opdracht lukt het niet een kopie te maken van mijn database naar mijn drive C:\ , ik krijg steeds een de melding "De backup is mislukt".
Private Sub Kopie_Click()
On Error GoTo fout
Dim fileObj As Object
Dim strBestandNaam As String
Dim strBackupNaam As String
Dim msg As Integer
'Dim fout As String
strBestandNaam = "Facturatie BJ 2010-2011.mdb"
strBackupNaam = Format$(Now(), "yyyymmdd") & strBestandNaam
strBestandNaam = CurrentProject.Path & "\" & strBestandNaam
strBackupNaam = "c:\" & strBestandNaam
Set fileObj = CreateObject("scripting.filesystemobject")
fileObj.copyfile strBestandNaam, strBackupNaam, True
msg = MsgBox("De backup is gelukt!")
Exit_Kopie_Click:
Exit Sub
fout:
MsgBox "De backup is mislukt!", vbCritical
End Sub
Private Sub Kopie_Click()
On Error GoTo fout
Dim fileObj As Object
Dim strBestandNaam As String
Dim strBackupNaam As String
Dim msg As Integer
'Dim fout As String
strBestandNaam = "Facturatie BJ 2010-2011.mdb"
strBackupNaam = Format$(Now(), "yyyymmdd") & strBestandNaam
strBestandNaam = CurrentProject.Path & "\" & strBestandNaam
strBackupNaam = "c:\" & strBestandNaam
Set fileObj = CreateObject("scripting.filesystemobject")
fileObj.copyfile strBestandNaam, strBackupNaam, True
msg = MsgBox("De backup is gelukt!")
Exit_Kopie_Click:
Exit Sub
fout:
MsgBox "De backup is mislukt!", vbCritical
End Sub