Am trying to back up MSaccess database using .bak file.. the that am using is below and it comes right at the place where i ve bolded the words and displays the source file doesnt exist error..
Private Sub BackUpDB()
Dim FSO As New FileSystemObject
Dim sDBfn As String
Dim sDBTmpfn As String
If FSO.FolderExists(App.Path & "/Backup") = False Then
FSO.CreateFolder App.Path & "/Backup"
End If
'set backup file path filename
sDBfn = App.Path & "/Backup/" & Format$(Date, "ddmmyyyy") & ".bak"
'set temporary file
sDBTmpfn = sDBfn & Now - DateValue(Now) & GetTickCount
If FSO.FileExists(sDBTmpfn) = True Then
FSO.DeleteFile sDBTmpfn
End If
'show ctl
progStat.Visible = True
lblCBK.Visible = True
DoEvents
'start backup
Set frmbackup.clsBKU = New clsHuffman
frmbackup.clsBKU.EncodeFile DBPathFileName, sDBTmpfn
'rename file
If FSO.FileExists(sDBfn) = True Then
FSO.DeleteFile sDBfn
End If
FSO.MoveFile sDBTmpfn, sDBfn
Set FSO = Nothing
progStat.Visible = False
lblCBK.Visible = False
End Sub