|
-
Oct 7th, 2006, 11:05 AM
#1
Thread Starter
Fanatic Member
Delete a file
Hello,
i want to delete my database using Kill App.Path & "\pcdb.mdb"
but the error message cmoes "ACCESS DENIED"
the full code is :
Private Sub CmdRestore_Click()
If Db.State = 1 Then
Db.Close
End If
SetAttr App.Path & "\Pcdb.mdb", vbNormal
Kill App.Path & "\pcdb.mdb"
If Db.State = 0 Then
On Error GoTo PerErr
FileCopy Direc & "\" & FileName, App.Path & "\pcdb.mdb" '& Format(Date, "dd/mm/yyyy") & ".mdb"
MsgBox "Restore completed ", vbInformation, "Restored"
SetAttr App.Path & "\Pcdb.mdb", vbHidden
PerErr: 'Access Permission (If Database is in use)
If Err.Number = 75 Then
MsgBox "Database is in use. Unable to create backup", vbCritical, "Database is in use"
Exit Sub
End If
End If
End Sub
please help me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|