Server.CreateObject() 在 32 位 Windows 和 IIS 7 中失败 [英] Server.CreateObject( ) failure with 32 bit Windows and IIS 7

查看:64
本文介绍了Server.CreateObject() 在 32 位 Windows 和 IIS 7 中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 7 32 位,IIS 7.5.760016385

Windows 7 32 bit, IIS 7.5.760016385

我在 Visual Basic 6.0 中创建了一个 DLL 并尝试在经典 ASP 代码中使用它:

I created a DLL in Visual Basic 6.0 and trying to use it from within classic ASP code:

set obj = Server.CreateObject("a.b")

我收到以下错误:

006 ASP 0178
Server.CreateObject 访问错误
检查权限时调用 Server.CreateObject 失败.拒绝访问此对象.
错误编号 = -2147024891

006 ASP 0178
Server.CreateObject Access Error
The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
err.number = -2147024891

我已尝试在此 ASP 页面的默认网站和虚拟目录中创建 iusr_cmpname 用户并授予其权限.我有 REGSVR32 的 dll.

I have tried creating the iusr_cmpname user and giving rights to it in the Default website and virtual directory of this ASP page. I have REGSVR32'd the dll's.

我已经转到打开和关闭 Windows 功能"并选择了 IIS/万维网服务/应用程序开发功能,然后检查了 ASP、ASP.net、ISAPI 扩展和 ISAPI 文件管理器.

I have gone to "Turn Windows features on and off" and selected IIS/World Wide Web Services/Application Development Features then CHECKED off ASP, ASP.net, ISAPI extensions, and ISAPI filers.

我在不同的新闻组中关注了许多线索,但我可以解决这个问题.我们去年,一年零 1/2 前尝试过这个,但遇到了同样的问题.由于我们无法克服这个问题,我们又回到了 Windows NT.我们在 NT 上从来没有遇到过这个问题.

I have followed many leads in different Newsgroups but I can get past this problem. We tried this last year, a year and 1/2 ago and had the same problem. Since we couldn't conquer this problem, we went back to Windows NT. We never had this problem on NT.

现在我们再次尝试解决这个问题,以便我们可以再次迁移到 Windows 7.似乎很多人都有这个问题,但他们找到并发布的任何解决方案似乎都不是我需要的.

Now we are trying again to get past this so we can move to Windows 7 again. It seems that many people had this problem but any solution they found and have posted, don't seem to be what I need.

任何帮助将不胜感激.谢谢.

Any help will be appreciated. Thank you.

推荐答案

该问题似乎与 IIS 无法访问文件系统上的自定义 VB6 Active X dll 有关.我在与默认 Web 应用程序相同的目录中注册了我创建的自定义 dll,并且能够让 ASP 创建对象.

The problem seems to be related to IIS not being able to access YOUR custom VB6 Active X dll on the file system. I registered a custom dll, that I created, in the same directory as the default web application and was able to get ASP to create the object.

这是我所做的:

  • Windows 7 Professional 64 位 SP1 的全新安装.

  • Clean install of Windows 7 Professional 64 bit, SP1.

启用 Windows ASP 功能

Enable the Windows ASP feature

此步骤仅适用于 64 位 Windows - 使用 IIS 管理器,为默认应用程序池启用 32 位应用程序.

This step ONLY for 64-bit Windows - Using IIS Manager, enable 32 bit applications for the default application pool.

  • 创建一个简单的 VB6 Active X dll(类名是CXUtils.Utils"),将两个输入数字相加并返回结果.

Utils.cls:

Public Function Sum(ByVal a As Integer, ByVal b As Integer) As Integer     
    Sum = a + b
End Function

  • 这是重要的一步 - 在管理命令提示符中,在默认 Web 应用程序位置注册 Vb6 Active X dll:C:\inetpub\wwwroot
    • 创建并安装一个简单的 asp 页面,从上面实例化 dll.安装位置是默认的 Web 应用程序位置 C:\inetpub\wwwroot

    默认.asp:

    <%@ Language=VBScript %>
    <%
    Option Explicit
    Response.Expires = 0
    Response.Expiresabsolute = Now() - 1 
    Response.AddHeader "pragma","no-cache" 
    Response.AddHeader "cache-control","private" 
    Response.CacheControl = "no-cache" 
    
    Function Sum(a, b)
        Sum = a + b
    End Function
    
    Function Sum2(a, b)
        Dim adder
        set adder = Server.CreateObject("CXUtils.Utils")
        Sum2 = adder.Sum(a, b)
        set adder = nothing
    End Function
    %>
    <html>
        <head>
            <title>Add</title>
        </head>
        <body>
        <b>2 + 3</b> = <%= Sum(2,3) %><br />
        <b>3 + 4</b> = <%= Sum2(3,4) %>
        </body>
    </html>
    

    • 浏览到网络应用并查看结果
    • 如果这不能全部编译,我很抱歉 - 进行了大量编辑才能使格式正确显示.

      My apologies if this doesn't all compile - there was a lot of editing to get the formatting to appear correctly.

      这篇关于Server.CreateObject() 在 32 位 Windows 和 IIS 7 中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆