locked
Problem calling COM component from client-side code RRS feed

  • Question

  • User-1654945686 posted

    Hello,

    I am working on getting a classic ASP application working under IIS 7 on a 64-bit Windows Server 2008 box.  It took me a long time to figure out how to access my VB6 COM+ component from ASP server-side code, but I got that working once I turned on the "Enable 32-bit Applications" property on the application pool that the app is running under.

    But now I want to be able to call the COM object from client-side code using RDS.  I am able to create the RDS DataSpace object and then a reference to the COM object without an error, but when I try to call the object I am getting "Internet Server Error".  Here is my sample code which is in a client-side vbscript routine:

      On Error Resume Next
      Set objDS = CreateObject("RDS.DataSpace")
      If Err.number <> 0 Then Exit Sub

      Set objTest  = objDS.CreateObject("MyObject.Code", "http://server1")
      If Err.number <> 0 Then Exit Sub
       
      Result = objTest.TestFunction()
      If Err.number <> 0 Then
        Msgbox "Error: " & Err.Description
      Else
        Msgbox "Test successful"
      End If

    This code works perfectly under IIS 6 on Windows 2003 when IIS6 is configured properly.  In IIS6 you need to add msadcs.dll as a Web Server Extension and create an MSADC virtual directory and application.  You also need to set the Execute Permissions on the MSADC application to "Scripts and Executables".

    I am wondering if I am missing the IIS7 equivalent of one of those steps.  I have added msadcs.dll to the ISAPI and CGI Restrictions list.  I have also enabled ISAPI-dll under Handler Mappings.  Am I missing something else?

    The object MyObject.Code is registered properly and is running under a COM+ application.  I have also added a MyObject.Code registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ADCLaunch.  I have no problem calling it from server-side ASP code, but I just can't seem to call it from client-side code using RDS.

    Any help would be greatly appreciated!
    Jay
     

    Friday, May 2, 2008 4:37 PM

Answers

  • User739250996 posted

    I just got this to work. Same problem, custom DLL works in server side but gives me 193 error on client side.

    You've got to make sure that the msadcs.dll in Web Server Extensions is in Program Files (x86) and not in Program Files. One houses 32 bit DLLs and the other 64 bit DLLs. Also, all the ISAPI filters for ASP must refer to Microsoft.net/framework and not Microsoft.net/framework64

    Hope this helps.

    Anna

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, July 10, 2008 9:39 PM

All replies

  • User-2095608498 posted

     

    hi dude, I have EXACTLY the same problem...  Did you manage to resolve it??

     

    Cheers

     Mike

    Wednesday, May 28, 2008 7:20 AM
  • User-1654945686 posted

    Unfortunately I got side-tracked on another project, so I haven't done any more work on this.  I'm still hoping someone will see this and have an idea, but I doubt that many people are still using RDS.



    Good luck figuring out the problem.  Please post something back if you get it working and I'll do the same.

    Thanks,

    Jay 

    Wednesday, May 28, 2008 9:44 AM
  • User1073881637 posted

    I haven't supported RDS calls since IIS 5, so I forget if RDS was part of the MDAC stack or what.  Here is a KB article.  http://support.microsoft.com/kb/251122

     

    Thursday, May 29, 2008 11:27 PM
  • User-1654945686 posted

    Steve,



    Thanks, I actually haven't seen that KB article before, but I am familiar with all of those common problems.  I think I have all of them covered except for possibly the one about setting permissions on the MSADC virtual directory.  In IIS 6 you just set the Execute Permissions to "Scripts and Executables".  What is the equivalent process in IIS 7 for making sure that the MSADC stuff is executable?  I added msadcs.dll to the ISAPI and CGI Restrictions list and also enabled ISAPI-dll under Handler Mappings.  Is there something else I need to do?  Or maybe the problem has nothing to do with this. 

    Thanks,

    Jay

     

    Friday, May 30, 2008 10:06 AM
  • User1073881637 posted

    Did you set the proper settings to execute / script etc..  Inetmgr > Request Restrictions > Access?

    I would even try copying files from w2k3 associated with RDS.  I don't know if there is a DLL you can register on IIS 7.

    Saturday, May 31, 2008 12:57 AM
  • User-2095608498 posted
    Hiya,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p><o:p></o:p>

     

    That night I emailed you, I got the damn thing working…<o:p></o:p><o:p> </o:p>Sorry I didn’t email you back sooner, but I got a bit side tracked, then I wanted to make sure I knew exactly what it was…<o:p></o:p><o:p> </o:p>Anyhow, here are the instructions:<o:p></o:p>1)       Go into IIS Manager and select the computer name on the left.<o:p></o:p>2)       Double click on “ISAPI and CGI Restrictions”<o:p></o:p>3)       Add a new one pointing to this file: C:\Program Files\Common Files\System\msadc\msadcs.dll<o:p></o:p>4)       Give it any name you like<o:p></o:p>5)       Tick “Allow Extension path to execute”<o:p></o:p><o:p> </o:p>That’s what fixed it for me!!!<o:p></o:p><o:p></o:p>
    Monday, June 9, 2008 3:19 AM
  • User-1654945686 posted

    Hi, thanks for getting back to me.  I'm glad you got it to work.  Unfortunately I had already added that DLL to ISAPI and CGI Restrictions and gave it the execute permission, but that didn't fix the problem.

    I'll keep looking and post something back if I get it working. 

     

    Monday, June 9, 2008 9:45 AM
  • User739250996 posted

    I just got this to work. Same problem, custom DLL works in server side but gives me 193 error on client side.

    You've got to make sure that the msadcs.dll in Web Server Extensions is in Program Files (x86) and not in Program Files. One houses 32 bit DLLs and the other 64 bit DLLs. Also, all the ISAPI filters for ASP must refer to Microsoft.net/framework and not Microsoft.net/framework64

    Hope this helps.

    Anna

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, July 10, 2008 9:39 PM
  • User1073881637 posted

    Thanks for posting a workaround.  I'm assuming your system is x64 running 32 bit app pools?

    Friday, July 11, 2008 1:39 AM
  • User-1654945686 posted

    Darn, Anna beat me to the punch!  I forgot to post a message back, but my problem was also solved when I added the MSADCS.DLL extension from the 32-bit Program Files folder rather than the 64-bit Program Files folder.

    Friday, July 11, 2008 9:47 AM