البحث في الموقع
Showing results for tags 'حفظ النسخة accde بالأكود فقط'.
تم العثور علي 1 نتيجه
-
السلام عليكم بحثت مطولا عن طريقة ما لحفظ التطبيق بصيغة accde باستخدام الاكواد وقد وجدت هذه الأكواد التى يتم تشغيل بعضها من خلال vb.net وبعضها خاص بالأكسس ولكن للأسف لم تعمل معى بشكل صحيح '1- By Vb.net 'Here's some code I tried (to make this work you need to set a reference to Microsoft Access 11.0 'Object Library) : Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Integer) As Integer Private Sub BuildMDE(ByRef strSource As String, ByRef strDest As String) 'strSource is the mdb file name ioAccess = New Microsoft.Office.Interop.Access.Application ioAccess.Visible = True SetForegroundWindow(ioAccess.hWndAccessApp()) 'Just to make sure Access is the foreground window! Try System.Windows.Forms.SendKeys.Send(strSource & "{Enter}{Enter}") System.Windows.Forms.SendKeys.Send("{Enter}") ioAccess.RunCommand(Microsoft.Office.Interop.Access.AcCommand.acCmdMakeMDEFile) Catch ex As Exception MessageBox.Show(ex.ToString) Finally System.Windows.Forms.Application.DoEvents() ioAccess.Quit() ioAccess = Nothing System.GC.Collect() 'OK we need som serious cleaning up here ...... End Try End Sub ---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- '2- By vb.net Function GenerateMDEFile(ByVal MyPath As String) Dim NAcc As Access.Application Dim convPath As String = "C:\convDB.mdb" Try NAcc = CreateObject("Access.Application") NAcc.ConvertAccessProject(MyPath, convPath, AcFileFormat.acFileFormatAccess2002) System.Windows.Forms.SendKeys.SendWait(MyPath & "{Enter}{Enter}") System.Windows.Forms.SendKeys.SendWait(MyPath & "{Enter}") NAcc.DoCmd.RunCommand(AcCommand.acCmdMakeMDEFile) Catch ex As Exception MsgBox("Exception: " & ex.Message & " " & ex.ToString, MsgBoxStyle.Critical) Finally System.Windows.Forms.Application.DoEvents() NAcc.Quit() NAcc = Nothing End Try End Function --------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------- ' On Access Vba Code Public Function MakeACCDESysCmd(InPath As String, OutPath As String) Dim app As New Access.Application app.AutomationSecurity = msoAutomationSecurityLow app.SysCmd 603, InPath, OutPath End Function يحتوى الأكسس على هذا الأمر الجاهز Docmd.RunCommand ACcmdMakeMDEFile ولكننى لم أستطع معرفة طريقة تمرير مسار قاعدة البيانات اليها فهل من مساعدة وجزاكم الله خيرا