New ASP user. ASP Doesnt seem to work

Windows 2000
IIS 5.0
Visual Basic 6.0

I am reading a book from WROX.  I am following it along and trying to set up my first project.  I first go into Visual Basic and click on a new IIS project.  When I do this I can click on run and it will generate a basic ASP page.  I then save the project and when I reopen it I get the following message.

The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
/Project1-0/WebClass1.ASP, line 14

I can not seem to figure this out.  I have went into the IIS manager and created a new folder under WWWRoot and have saved the project there and try and run it but no luck.  

What is going on!!!!!
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

gbarenConnect With a Mentor Commented:
I have had this problem. The problem was that the IUSR_machine didn't have the rights to instantiate the object.

By setting the application protection high, you cause a different process (not IIS) to load your DLL.

You should also set the directory security for the project directory to Integrated. Remove Anonymous!!

This only applies to the development system. You will not have these problems on the Web server.

I never use VB for building ASP project.
I recommend you using VisualInterdev instead.
Also, you do not have to create a new project in order to successfully creat your web-based application.  I always just create page by page and have not had problem doing that.

1. Go into the IIS Management Applet
    W2K - Right-click My Computer/Manage/Services and Applications/Internet Information Services
    NT - It's on the menu somewhere, I don't recall.

2. Open Default Web Site

3. Find your project in the list of Virtual Directories

4. Right-click/Properties on your project's VD

5. Application Protection: High (Isolated)

6. Click Unload (if not greyed out)

This should take care of it.


The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.


Please post your VB code.

Wee Siong
Agree with weesiong, please post code.  Also Win 2000 has an easy setup for db in OBDC sources for easy DSN naming, and will null permissions for network use. Regards, dmoring
Quite obvious this is a security problem and has nothing todo with the code you wrote.

The solution will be to configure your IIS correctly. Make sure that you have switched on the execute-permission on your project in IIS (Home-directory tab).
Michel SakrCommented:
The IIS is locking the object and it's not multythreaded.. include the component in COM+  and work on it or restart IIS service.

How do I avoid 'Permission Denied' when re-compiling?

Use this batch file to release IIS' lock on your DLL:
    net stop iisadmin /y
    net start w3svc
You may need to add start lines for other services such as smtpsvc or msftpsvc. The disclaimer of course, if you're worried about stopping your web site traffic: don't develop DLLs on production machines.
If you are developing your ASP files using Visual InterDev, then IntelliSense may be doing you a disservice. Since this feature actually hooks into your custom COM objects (once you've created them using their ProgID in a createobject() statement), this places a lock on the DLL similar to the one IIS places on it. So if you are editing an ASP file which calls the DLL in question, you can recompile without rebooting by simply closing the ASP file.
You may also find the need to use KILL.EXE, if iisadmin refuses to be shut down. KILL.EXE is found in the NT and Windows 2000 Resource Kits. As long as the .EXE is in your system's path, you can modify the above script as follows:
    net stop iisadmin /y
    kill iisadmin
    net start w3svc

or include the dll in COM+

Start the Component the tree select computers.. applications...right click on it--> new -> application.. now in the wizard click next and select an empty application -> name your package  leave it in server process and click next -> Select the user and enter an account with enough rights to fufill your com jobs (admin account for ex) -> Finish..

now in the tree expand the new package untill you see the component directory-> right click it -> select new component-> in the wizard click next.. you can either install a new component if it's not registred or install a registred one if you already registred your dll (you select the 2nd choice) -> Select your component from the list (internal name displayed) -> Finish..
sTHomasAuthor Commented:
I have tried all suggestions but none seem to work. Done the following:

Reinstalled IIS
Upgraded to SP5 on VB6
changed rights, etc

I did some research on Microsofts Site and found information similiar regarding this problem.  They suggested I use a package called FileMon.  I ran Filemon and it did indeed show that the mswcrun.dll was giving me an access denied error.  I reregistered the dll and still no success.  I changed the rights on this file and I no longer get the access denied in Filemon but I still get the exact same error when I try and load the ASP file.

If I create the asp file myself, It runs just fine.  When you create a project in MS IIS it loads some default code.  I look inside the code and this is where I believe it is erroring

:Application"~WC~WebClassManager").ProcessNoStateWebClass "Project1.WebClass1", _
          Server, _
          Application, _
          Session, _
          Request, _

It would not matter whether I use InterDev to develope because it still errors on this line of code.  I guess I could just bag VB IIS and write through some other program but I would like this to work.

Anyone else had this same problem?????

sTHomasAuthor Commented:
I got so frustrated on this one I called microsoft.  They had me Start/RUN/DCOMCFG.  an application is loaded and they had me go into the Default Security and add ISUR_Machine to all three boxes.  This took care of the problem.  I will give the points to gbaren since I think he was on the right track.

Thanks for all your help.
sTHomasAuthor Commented:
It was a user rights issue but It could only be resolved in the DCOMCFG application.

Thanks for your help!!
Michel SakrCommented:
whew.. I see a new bad grader was born..
All Courses

From novice to tech pro — start learning today.