ارجو المساعدة في تعديل الكود التالي حيث اريد عمل نسخة مضغوطة من قاعدة البيانات بجانب النسخة العادية التي تم نسخها في نفس الفولدر
الكود المراد التعديل عليه :
()Private Sub Form_Timer
_ , ("هل تريد عمل نسخ احتياطية من البرنامج"If MsgBox
vbInformation + vbOKCancel, _
vbOK Then = ("رسالة تنبيه"
Dim OldFile, DBwithEXT, DBwithoutEXT, NewFile, CopyMyDB
OldFile = CurrentDb.name
DBwithEXT = Dir(OldFile)
DBwithoutEXT = Left(DBwithEXT, Len(DBwithEXT) - 4)
' Next line shows the required path for the backup database
NewFile = "D:\backup.mdb"
CopyMyDB = "cmd.exe /C copy " & """" & OldFile & """" & " " & """" & NewFile & """"
Shell CopyMyDB, 0
MyErr:
If Err.Number <> 0 Then
MsgBox Err.Number & " - " & Err.Description
End If
Call Shell("regedit.exe /s """ & CurrentProject.Path & "\Enable.reg""", 0)
"تم النسخ بنجاح" ,vbOKOnly ,"تم نسخ قاعدة البيانات بنجاح .." MsgBox
End If
DoCmd.Quit
End Sub
