2 Replies Latest reply on May 5, 2013 7:15 AM by al1

    How to open two LibraryManager databases at the same time?

    al1

      Hello!

       

      How to open two LibraryManager databases at the same time?

       

      I need to compare two LibraryManager databases and copy some data from one to another. I can open one, save some data into collection, close, open another and compare collection with another. Is there way without an additional collection?

       

      I do the next:

       

        jobSource        = "/home/al1/pub/projects/al1-2163/Central_Library_2/Central_Library_2.lmc"

        jobDestination   = "/home/al1/pub/projects/xxx/Central_Library_2/Central_Library_2.lmc"

       

      ' Opening base 1

        Set appObjSrc = CreateObject("MGCPCBLibraries.PartsEditorDlg")

        Scripting.AddTypeLibrary("MGCPCBLibraries.PartsEditorDlg")

        Set libObjSrc = appObjSrc.OpenDatabaseEx(jobSource,False)

       

      ' Opening base 2

        Set appObjDst = CreateObject ("MGCPCBLibraries.PartsEditorDlg")

        Set libObjDst = appObjDst.OpenDatabaseEx(jobDestination,False)

       

      ' ...

       

      After I open the base 2, libObjSrc destroyed and I can't read it. If I comment opening the base 2 - libObjSrc can be read.

      Is there any solution?

       

      Thanks!

        • 1. Re: How to open two LibraryManager databases at the same time?
          Satoru

          Hello Al1-san,

           

          Two databases can be opened if you start the Parts Editor from the Library Manager.

          Please check.

           

          Regards,

          Satoru

           

          ================================================================

          jobSource      = "/home/al1/pub/projects/al1-2163/Central_Library_2/Central_Library_2.lmc"

          jobDestination = "/home/al1/pub/projects/xxx/Central_Library_2/Central_Library_2.lmc"

           

          Scripting.AddTypeLibrary("LibraryManager.Application")

          Scripting.AddTypeLibrary("MGCPCBLibraries.PartsEditorDlg")

           

          'Start Library Manager 1

          Set lmcAppSrc = CreateObject("LibraryManager.Application")

          Set lmcDocSrc = lmcAppSrc.OpenLibrary(jobSource)

           

          'Start Library Manager 2

          Set lmcAppDst = CreateObject("LibraryManager.Application")

          Set lmcDocDst = lmcAppDst.OpenLibrary(jobDestination)

           

          'Opening PartsEditor 1

          Set appObjSrc = lmcDocSrc.PartEditor

          appObjSrc.Visible = False

          Set libObjSrc = appObjSrc.ActiveDatabaseEx

           

          'Opening PartsEditor 2

          Set appObjDst = lmcDocDst.PartEditor

          appObjSrc.Visible = False

          Set libObjDst = appObjDst.ActiveDatabaseEx

           

          MsgBox libObjSrc.FullName & vbCrLf & libObjDst.FullName

           

          appObjSrc.Quit

          appObjDst.Quit

          lmcAppSrc.Quit

          lmcAppDst.Quit

          ================================================================

          • 2. Re: How to open two LibraryManager databases at the same time?
            al1

            It works, thank you very much!