Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21356

how to bypass the permission denied when backing up database

$
0
0
does somebody know's how to bypass permission denied?

i tried to open the db close it played with it but still no luck i get permission denied

Code:

Private Sub doBackup()
cd1.InitDir = App.Path 
cd1.FileName = cd1.InitDir & "\HairDesign" & Format(Now, "dddd-mm-yyyy") & ".mdb"
cd1.ShowSave
Dim targetFile As String
targetFile = cd1.FileName

If Dir(targetFile) = "" Then
    FileCopy App.Path & "\HairDesign.mdb", targetFile
ElseIf MsgBox("backup exists overwrite it?", vbYesNo) = vbYes Then
CN.Close
    FileCopy App.Path & "\HairDesign.mdb", targetFile
    MsgBox "BackUp Succeeded", vbInformation
      CN.Open
    frmBackupDba.Hide
 
End If

End Sub

Viewing all articles
Browse latest Browse all 21356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>