×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

It could be access issue.

If your COM object is in-proc, it will be running in hosting process by default. Since later versions of IIS was designed to run under special network account which access is limited, the workaround would be running the COM objects in a separate surrogate process which runs using admin. You can create an empty COM+ application, make sure it runs as admin or local system, and drag your COM dll into it. In this case, the COM+ application (it runs using a separate process) will be your COM object' host, and when ASP tries to create your COM object, your COM object will be created in the COM+ application which runs as admin. This doesn't require any code change and works for most of in-proc COM objects.
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / ASP访问COM的问题,请教各位高手
    现在有一个COM,这个COM需要访问本地系统的一些资源(比如注册表,Trusted Certificate Store,等)。现在有个客户需要在ASP里面访问这个COM,如果直接在本地运行VBSript就没有问题,一旦需要从web server load的时候,就出错,出错的原因是没有成功的访问注册表和cert store。请问如何才能使从web server load,有可以访问这些本地资源的。另外,他用CreateObject() 来创建COM,是不是应该用Server.CreateObject()?多谢
    • 感觉可能是权限的问题
      • 只是调用一些函数访问Trusted Certificate Store,注册表只是打个比方。如果是cert store,有什么地方可以设置访问权限呢?
    • In ASP.NET, you can use impersonate to solve some security issues. I’m not sure that in legacy ASP if you can use impersonate or not. Anyway check it in MSDN.
    • The COM object was activated using ASP's process token. Check the configuration of your COM object, make sure it is not launch as invoker (default for normal COM objects).
    • I think is user permission problem. try following url
      http://support.microsoft.com/default.aspx?scid=kb;EN-US;q296114
    • 多谢上面的回答,另外我在我的Windows 2000上用IIS 5.0测试,完全没有问题。好像certificate store的访问策略在Windows 2003和Windows 2000有点不同。Any more tips? Thanks
      • What kind of user context are you running IIS in Win2K and Win2003? And what is the activation method of your COM object?
        • 我不懂ASP的东西。COM是我写的,现在有一个客户要用在ASP中。我就直接把ASP文件放在wwwroot中的。ASP文件如下:
          <%@ LANGUAGE = VBScript %>
          <%
          Const TEST_ID1 = "67206530016"
          Const TEST_ID2 = "xxxxxxx"
          Dim comAdaptor

          ' 1. Create the COM object.
          Set comVxnAdaptor = CreateObject("mycom.MyAdaptor")

          StringPayload = "SAMPLE PAYLOAD"

          iRet = comAdaptor.SimpleFunction(ClientRef, StringPayload, StringResponse)
          %>
          • It could be access issue.
            If your COM object is in-proc, it will be running in hosting process by default. Since later versions of IIS was designed to run under special network account which access is limited, the workaround would be running the COM objects in a separate surrogate process which runs using admin. You can create an empty COM+ application, make sure it runs as admin or local system, and drag your COM dll into it. In this case, the COM+ application (it runs using a separate process) will be your COM object' host, and when ASP tries to create your COM object, your COM object will be created in the COM+ application which runs as admin. This doesn't require any code change and works for most of in-proc COM objects.