إنه بعد السلام عليكم وإنه بسم الله الرحمن الرحيم
لمتابعة اجابة على موضوع مغلق ،
ولعمل نسخة احتياطية من قاعدة البيانات برمجياً
في أكسس 2003 :
CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Back up database...").accDoDefaultActionوفي اصدارات تالية مثل 2007 و 2010 :
Dim sourceFile As String, destinationFile As String
Dim aFSO As Variant
Dim path As String, name As String
sourceFile = CurrentProject.FullName
path = CurrentProject.path
name = CurrentProject.name
destinationFile = path & "\" & Left(name, Len(name) - 6) & "_backup" & "_" & Year(Now) & "_" & Month(Now) & "_" & Day(Now) & ".accdb"
If Dir(destinationFile) <> "" Then
Kill destinationFile
End If
If Dir(destinationFile) = "" Then
Set aFSO = CreateObject("Scripting.FileSystemObject")
aFSO.CopyFile sourceFile, destinationFile, True
MsgBox destinationFile & " تم عمل نسخة في المسار "
End Ifوبالمرفق مثال معدل لكود الأستاذ / Maxxin
مع خالص تحياتي المؤقتة للزملاء جميعاَ