Professional Web Applications Themes

SP_OACreate - Microsoft SQL / MS SQL Server

Hi, We have a web server say "server1" and a database server say "server2". I have installed a DLL say "test.dll" as a COM+ component on server1. The test.dll has also been registered on server2. test.dll is a vb6 dll. How do I use SP_OACreate to instantiate test.dll from server1 from the database server "server2"? An early reply would be appreciated. Regards, Venugopal...

  1. #1

    Default SP_OACreate

    Hi,
    We have a web server say "server1" and a database server
    say "server2". I have installed a DLL say "test.dll" as
    a COM+ component on server1. The test.dll has also been
    registered on server2. test.dll is a vb6 dll. How do I
    use SP_OACreate to instantiate test.dll from server1 from
    the database server "server2"? An early reply would be
    appreciated.
    Regards,
    Venugopal
    Venugopal Guest

  2. #2

    Default sp_OACreate

    Hi,
    We have a web server say "server1" and a database server
    say "server2". I have installed a DLL say "test.dll" as
    a COM+ component on server1. The test.dll has also been
    registered on server2. test.dll is a vb6 dll. How do I
    use sp_OACreate to instantiate test.dll from server1 from
    the database server "server2" like it is done in vb i.e.
    CreateObject("test.dll","server1")? An early reply would
    be appreciated.
    Regards,
    Venugopal

    Venugopal Guest

  3. #3

    Default sp_OACreate

    Hi Venugopal.

    You could use DCOM / COM+ to do this, or possibly
    implement a SOAP wrapper. A SOAP wrapper has the advantage
    of not needing RPC (only needs HTTP & therefore great for
    internet / WAN) between the servers, but is not an "out of
    the box" and considerably more complex, so I won't go
    further into that here.

    To implement a simple DCOM solution, read the MS KB
    article 266717 - this uses an example to demonstrate how
    to create an installer that understands the VB6.0 .dll is
    to be accessed remotely. It can be found here (the url
    might wrap):

    http://support.microsoft.com/default.aspx?scid=kb;en-
    us;266717

    When using a solution like this, you don't install your VB
    COM Server as an ActiveX.dll. Instead, you package it as
    an ActiveX.exe because the VB program needs to run in a
    Windows process on the remote computer. On the SQL Server
    (the client), a .tlb (Type Library) file is installed so
    that the class interfaces supported by the VB COM server
    are known locally (HKEY_CLASSES_ROOT/CLSID entries are
    present & therefore sp_OACreate works). Then a remoting
    file (.vbr) installs registry entries that re-direct call
    to the VB COM Server (on the other computer). Read the
    article though, as this is fairly well explained there.

    COM+ allows you to deploy your VB COM Server as a .dll
    rather than as a .exe because COM+ provides a Win32
    process to host the VB COM Server. This can be a higher
    performance solution and especially attractive if you need
    fast instantiation / re-instantiation of your remote
    objects. Installation is similar - you can export COM+
    proxy packages or even re-use the method explained by the
    DCOM example. The main difference between DCOM & COM+
    methods is that the COM+ allows .dlls is designed for
    higher performance as it has additional technology such as
    [J]ust [I]n [T]ime (JIT) activation, pooling etc..

    HTH

    Regards,
    Greg Linwood
    SQL Server MVP
     
    Greg Guest

  4. #4

    Default Re: SP_OACreate

    I assume you are having a problem you're not telling us about because the
    answer should be to just call sp_OACreate with the progid of the com+
    component proxy you have registered on server2. What kind of error do you
    get when you do this?

    Thanks,
    Roger Wolter

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm.



    "Venugopal Vemuri" <com> wrote in message
    news:03f101c34940$bccf1b50$gbl... 


    SQL Guest

Similar Threads

  1. sp_OACreate permissions in SQL Server 2000.
    By Dinesh.T.K in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 8th, 02:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139