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.
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.
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.
Utils.cls:
Public Function Sum(ByVal a As Integer, ByVal b As Integer) As Integer
Sum = a + b
End Function
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>
My apologies if this doesn't all compile - there was a lot of editing to get the formatting to appear correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With