11
votes

Windows 7 32 bit, IIS 7.5.760016385

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")

I get the following error:

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

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.

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.

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.

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.

5
What is the error message you are receiving from IIS?Treborbob
Err.description is "006~ASP 0178~Server.CreateObject Access Error~The call to Server.CreateObject failed while checking permissions. Access is denied to this object." err.number = -2147024891user1894838
have you tried to make the apppool user/the iusr an local administrator? just for testing... or use another windows user for the appool and the web application wait... have you tried to add a web application instead of a virtual directory?ulluoink
Thanks for your suggestions. Giving Administrator rights to iusr_xxx and "Network Service" didn't help. I don't know how to set another user for the Application Pool, I don't see a security tab from the Application pool in the IIS Administrator. I have tried, as you suggested to change the virtual directory to an application but then the page doesn't open at all; it just hangs. So I have changed it back to a Virtual Directory. Thanks for your thoughts.user1894838
In IIS7 the iusr is invisible, but you can still add rights. In the requester where you select a User or Group just type: IIS APPPOOL\{application pool name} and click 'check names'. Not a solution for your problem, but it might get you closer to a solution...Erik Oosterwaal

5 Answers

4
votes

I strongly recommend using Procmon to find the access violation. I had a similar issue years ago, and this was the only thing that solved it. In that scenario, it turned out to be a lack of permissions on the system temp folder.

If you post the results from Procmon, I may be able to amend this answer to be more helpful.

4
votes

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.

Here's what I did:

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

  • Enable the Windows ASP feature

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

enable 32-bit application pool

  • Create a simple VB6 Active X dll (class name is "CXUtils.Utils") that adds two input numbers, and returns the result.

Utils.cls:

Public Function Sum(ByVal a As Integer, ByVal b As Integer) As Integer     
    Sum = a + b
End Function
  • This is the important step - in an administrative command prompt, register the Vb6 Active X dll in the default Web application location: C:\inetpub\wwwroot

Register Custom VB6 DLL

  • Create and install a simple asp page that instantiates the dll from above. The install location is the default web application location C:\inetpub\wwwroot

Default.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>
  • Browse to the web app and see the results

Sample asp page results

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

0
votes

This page suggests that the problem may be the access rights assigned to the VB runtime. Try assigning everyone read and execute permissions on Msvbvm60.dll.

http://support.microsoft.com/kb/278013

0
votes

I think I was having a similar problem. I was trying to interactivey debug code in a VB6 DLL that was running in the VB6 IDE from a classic ASP application. When the application executed the Server.CreateObject statement it returned the following error:

Server object: 006~ASP 0178~Server.CreateObject Access Error~The call to Server.CreateObject failed while checking permissions. Access is denied to this object.

BTW, I am running IIS 7.5 in a Windows 7 environment. I finally found a Microsoft article that said the problem was due to a missing registry entry for VB ASP Debugging in DCOM and/or inadequate permissions with DCOM, not IIS. The URL for the article is http://support.microsoft.com/kb/q259725. I implemented Work Around #1. One re-boot later, I could step into the VB DLL code from ASP. Chalk one up for Microsoft, and I don’t say that very often :-)

0
votes

Another approach that might work, is to install the DLL as DCOM application on dcomcnfg. It will run under different credentials.