اذهب الي المحتوي
أوفيسنا

كود حفظ نسخة من قاعدة البيانات ( الجداول )


كوماندير

الردود الموصى بها

السلام عليكم ورحمة الله وبركاته

شباب لدي كود حفظ نسخة من قاعدة البيانات الحالية .

المطلوب هو تغيير الكود ليحفظ نسخة من قاعدة البيانات (الجداول ) حيث ان قاعدة البيانات لدي مقسمة .

الكود هو :

 

Dim OldFile, DBwithEXT, DBwithoutEXT, NewFile, CopyMyDB, strFolderName
OldFile = CurrentDb.Name
DBwithEXT = Dir(OldFile)
DBwithoutEXT = Left(DBwithEXT, Len(DBwithEXT) - 6)
'OurDb Backup
strFolderName = "D:\LabDb Backup"
If Len(Dir(strFolderName, vbDirectory)) = 0 Then
     MkDir (strFolderName)
     End If
' Next line shows the required path for the backup database
NewFile = strFolderName & "\" & DBwithoutEXT & " " & Format(Date, "dddd dd mmmm yyyy") & Right(DBwithEXT, 6)
CopyMyDB = "cmd.exe /C copy " & """" & OldFile & """" & " " & """" & NewFile & """"
Shell CopyMyDB, 0
MsgBox "áÞÏ Êã ÍÝÙ äÓÎå ÇÍÊíÇØíÉ ÈäÌÇÍ Ýí ÇáãÓÇÑ " & vbCrLf & _
 strFolderName
'MyErr:
'If Err.Number <> 0 Then
'MsgBox Err.Number & " - " & Err.Description
'End If
If MsgBox("åá ÊÑíÏ ÇáÎÑæÌ ãä ÇáÈÑäÇãÌ ÝÚáÇ ¿ ", vbMsgBoxRight + vbMsgBoxRtlReading + vbCritical + vbYesNo, "ÊÍÐíÑ åÇã ¿") = vbYes Then

DoCmd.Quit
End If

 

 

سؤال على الهامش ؟

عند تجربتي لهذا الكود على قاعدة بيانات تعمل على جهاز عليه Windows7 تعمل جيدا بدون مشاكل ، الملاحظ انه عند نقلي لقاعدة البيانات على جهاز به وندوز اكس بي ان شكل النماذج في النسخة المحفوظة تغير ، ماهو السبب برأيكم ؟

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information