Running Classic ASP on IIS7

Classic ASP developers could find them self in a question-mark-above-my-head state when migrating classic ASP websites to IIS7 or IIS7.5 environment.

Show me my errors!

Classic ASP Errors Shown In Browser
Classic ASP Errors Shown In Browser

First thing that might surprise you is that no errors are sent to your browser. Changing settings in .NET Error Page doesn’t do a darn thing for Classic ASP. Neither does changing web.config file.

In order for errors to show up in your browser you need to go to IIS section of web site properties. Select ASP icon and expand Debugging properties. Next, change “Send Errors To Browser” from “False” to “True”. And voila, errors are back in your browser. And this is not a bad thing, you are on your way to a bit more configuring due to errors you can now see.

Why my ODBC connection strings aren’t working?!

Enable 32-bit Applications
Enable 32-bit Applications

If you are running Windows Server 2008 x64 and if your web sites are using ODBC drivers to connect to Access, suddenly any connection string that you might try just isn’t working. You check and double check your code, but nothing seems to work. The reason behind that is that x64 variant of Windows is by default creating Application Pools for x64 environment, and ODBC Access driver is running in x86 (32 bit) environment. Only driver that it available in x64 environment of SQL Server driver. But, all is not lost, x86 drivers are still here! Running odbcad32.exe from C:\Windows\SysWOW64\ folder is showing all the drivers that you are used using are still there. But somehow these drivers are not accessible through your application. To enable your application to use these drivers, you need to enable 32bit applications. For every new web site IIS7 creates new Application Pool. Find an Application Pool for the web site that needs ODBC drivers and in the right pane select “Advanced Settings”, in the opened panel change “Enable 32-bit Applications” from “False” to “True”.

One more thing that might be a problem is an old error when you try to write something into your database like Access which is common when permissions aren’t set right for IUSR_machinename user. On IIS6 and earlier all you had to do is give IUSR_machinename user write permission on your Access database file. Doing the same when running your web site on IIS7 doesn’t work. In the Advanced Settings panel of your Application Pool (shown above) you can do two thing. First is that you can change “Load User Profile” from “True” to “False”.

Why I can’t register my ASP components?!

Using ASP components like aspSmartUpload, aspSmartMail, GFlax, ASPTear and all the components used on IIS6 you cannot register on IIS7 with error “The module … failed to load.” On IIS6 servers my components were located under a specific folder, did the same on IIS7 and the error earlier showed up. The solution is quite simple. Copy all of your old ASP components to C:\Windows\SysWOW64\ folder and from there run regsvr32.exe command to register your components.

One thought on “Running Classic ASP on IIS7

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.