8 Replies Latest reply: May 15, 2014 10:05 AM by Nick Osdale-Popa RSS

    Monarch COM & SSIS

      Howdy - -


      I'm trying to call Monarch from an SSIS script task.

      The SSIS script task is VB.NET.


      One constraint is that one cannot call COM from SSIS; so, I created a Monarch Interop dll from Monarch.TLB.  Now that the library reference is .NET, I can call the Monarch library.


      This works to a point:  I can instantiate the Monarch object.  The problem is that I'm unable to call any methods, and here's the error that's generated:


      Unable to cast COM object of type 'Interop.Monarch.MonarchClass' to interface type 'Interop.Monarch._DMonarch'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{0D73C440-D7B9-101B-A6B5-00AA001B1AB4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).[/INDENT]




      Does anoyone know where to go with this?


      - - Herb Ray

        • Monarch COM & SSIS
          Data Kruncher

          Hi Herb,


          I don't have first hand experience with the environment(s) with which you're attempting to accomplish your task, but I wonder if a workable if decidedly less elegant solution exists if you can call a VBS script from your SSIS script.


          Calls to Monarch's COM methods and properties can be made with VBS.


          Just an idea. Sorry I don't have more for you. Gareth and/or Nick?



            • Monarch COM & SSIS
              Olly Bond

              Hello Herb,


              I don't know about a fix to get Monarch controlled by SSIS, but I do know that Monarch Data Pump Pro makes a feature out of the fact that it can be controlled by SSIS.


              In fact, as this integration is only possible in DataPump Pro and not in DataPump Standard, I suspect that it won't be straightforward in Monarch.


              It's not a feature we have needed to use here so far, so I'm afraid I can't give you any practical help. Gareth, and perhaps Bill and others, on this forum or on the DataPump board will be able to answer in more depth.


              Best wishes,



                • Monarch COM & SSIS

                  Olly - -


                  It seems that, since the Monarch API is already exposed (COM), one shouldn't have to further complicate the environment with DataPump.  In Microsoft's world, COM itself is more or less legacy.  I wonder why DataWatch doesn't upgrade their Monarch API.


                  That said, I may have to eventually buy DataPump.


                  In the mean time, I will use the VBS task until I figure this thing out.


                  I remain open to suggections on calling Monarch from SSIS/VB.NET.


                  - - Herb

                    • Monarch COM & SSIS

                      All - -


                      I realized the problem when I looked at it from the perspective of Visual Studio 6:


                      Visual Studio 6 is a COM environment.  The problem presented there as well, though with slightly different error messages.


                      For some reason, the Monarch library does NOT support early binding.  Even though using VB6 and not VBS, CreateObject() was still required (late binding).  Creating a COM library reference and then "Dim As MONARCHLib.Monarch" (early binding) fails utterly.


                      So, it turns out that although formal references to COM from the SSIS Script Task (early binding) is not supported, one can call COM via CreateObject() and settle for late binding.


                      DataPump is completely unnecessary here.  Monarch COM can be called directly from the SSIS VB.NET Script Task using late binding.


                      - - Herb

                        • Monarch COM & SSIS
                          Data Kruncher

                          Glad to hear that you've got it resolved Herb, but I feel badly about it as I am fully aware of the late/early binding issues, but the thought didn't even cross my mind as I was/am unfamiliar with your programming environment.


                          I've gone to fair effort to remove these binding issues from my Monarch automation by creating a reusable custom Monarch class which handles each and every method and property. Even created some of my own.


                          Again, glad to hear that you're on your way with this.

                            • Monarch COM & SSIS

                              Kruncher - -


                              You have piqued my curiosity.  How is it that you call the Monarch library with early binding?  I understand that you can call your custom class with early binding, but are you not instantiating Monarch with late binding within your custom class?


                              - - Herb

                                • Monarch COM & SSIS
                                  Nick Osdale-Popa

                                  In his class, he is still using Late Binding - as you have discovered, early binding is not supported with Monarch.  He does set a reference to the Monarch.tlb, though I'm not sure why. He sets the Monarch object to a generic object. Now, he could set it to an actual Monarch object, and get the full intellisense out of the IDE, but it would have to be set back to a generic object in order for the code to actually run.  This was expressed by url=http://www.monarchforums.com/showthread.php?t=1057Gareth[/url] back in 2005.

                        • Monarch COM & SSIS

                          Kruncher - -


                          There is an ActiveX scripting task.  VBS is an option with this task; however, Microsoft is promising that this legacy functionality will eventually go away.


                          For years, now, I have been successfully calling the Monarch library from DTS/ActiveX/VBS.  DTS is legacy, replaced by SSIS.  Probably I can call the Monarch library from the SSIS/ActiveX script task, but the idea is to get away from ActiveX before Microsoft pulls the plug.


                          - - Herb