“Server Application Error” error message when attempting to run ASP page under IIS 5.0

System Requirements:

  • Windows 2000 & IIS 5.0

The Problem:

Yet another hpcfactor.com server failure later and we have some new problems. When attempting to parse asp pages, the browser retorts with an error headline “Server Application Error” and populates the event log with Event ID 36:

The server failed to load application ‘/LM/W3SVC/1/Root’. The error was ‘No such interface supported’

Note that the 1 in /LM/W3SVC/#/Root can be any number representing the identifier for any virtual web on your server e.g. ‘/LM/W3SVC/2/Root’, ‘/LM/W3SVC/3/Root’, ‘/LM/W3SVC/23/Root’.

HTML pages will display correctly, however anything that is running through the ASP interpreter will fall foul of this error message.

An additional symptom that you may have noticed is that the error will only occur if your Application Protection settings in IIS 5.0 are set to Medium or High.

More Info:

In the case of hpcfactor.com the problem began quite innocently with Teoma (Ask Jeeves’ crawler) starting a run over the site root, and suddenly stopping seemingly randomly when the server kicked back a 500 error:

Out-of-process ISAPI extension request failed

From that single request on, for another 6.5 hours before an administrator noticed every single request to the ASP interpreter on the particular server returned another 500 error:

Out-of-process ISAPI extension has exceeded crash limit.

Rendered in MSIE as:

The server has reached the maximum recovery limit for the application during the processing of your request. Please contact the server administrator for assistance

In playing around with the server for a little while, restoring a metabase backup and repairing some lost NLS files, we were able to get the server to perform again without the ISAPI errors, however the server would not output any ASP, returning “Server Application Error” every time and for each page request writing Event ID 36 to the System log.

I quickly discovered that if I lowered the Application Protection settings from Medium, to Low, the site would correctly load ASP pages, however there is an inherent problem in doing this – it does not lead to good stability; in fact you are essentially running IIS 5.0 as if it were IIS 3.0.

Low (IIS Process): This is the way IIS ran prior to IIS 4; all requests are performed in the InetInfo.exe process. This is the fastest option, but it is also the least robust because a rogue application could crash the InetInfo.exe process.

Medium (Pooled): This is a new option in IIS 5 and is the default setting for all new Web applications. In this model, all parts of the Web space marked as Medium (Pooled) run in the same process external to InetInfo.exe. As already mentioned, the process name is DllHost.exe and this process does not run as LocalSystem as InetInfo.exe does. Instead, DllHost.exe runs under the identity of an account controlled by IIS. By default, the identity is IWAM_machinename.

High (Isolated): This option, introduced in IIS 4 and shown in Figure 5-33, executes each Web .application in its own instance of DllHost.exe that runs in the context of the IWAM_machinename account. In doing so, it offers the highest degree of robustness, but it’s not as fast as Medium.

Source: MS Press Book Sample

In case you have read anyone else’s ideas over doing this – this is NOT a solution, it’s madness unless you are hosting your own little photo album for Billy Bob and the rest of the clan.

The common link between the higher process modes is obviously the IWAM_machinename account on the system, there is some excellent advice around the Internet on troubleshooting it already, and unless the next line matches your case, I suggest for follow it – start by re-synching the IWAM account using the AdminScript for IIS 5.0.

The next line: Check to see whether IIS is still registered in the COM+ registration database.

MMC the console applet found at %SystemRoot%\system32\Com\comexp.msc

If you see this, troubleshoot IWAM
ASP COM+ Registered
If you see this, you know why ASP doesn’t work (It should look like the image above)
ASP COM+ Failure

Effectively it is not possible to utilise Application Protection without the COM+ registrations. To fix them:

  1. Backup your server
  2. Backup the IIS 5.0 metabase
  3. Stop IIS Admin and associated services
  4. Pull up a command prompt
  5. Enter (Case sensitive):
    rundll32 %windir%\system32\inetsrv\wamreg.dll, CreateIISPackage
  6. Hit OK
  7. Enter:
    regsvr32 asptxn.dll
  8. Hit OK
  9. Restart IIS Admin and associated services
  10. Return to the comexp.msc view and check whether the three IIS registrations have returned, if they have start returning your web sites to Medium (Pooled). You will need to restart IIS in order for the Application Protection change to take effect.

RFC1766 International Language Identification Downloadable Stores

System Requirements:

  • A Language Code Problem
  • Text/CSV Viewer, Excel 2003, Access 2003

The Problem:

If you have ever been mildly curious in the language ID listing, or ever engaged in a project where language identification was important having to come up with a digital list of the language can be a time consuming business.

This article simply saves you the time, having had me spend the time compile the list for you!

The Fix:

If you need the language list, you can use my files below as a base for your project.

The data source has been taken from Microsoft Windows XP’s registry, so any errors are universally Microsoft’s problem if indeed there are any.

I have made the following three files available:

  • Comma Separated Variable (CSV) Text File
  • Office Excel 2003 Spreadsheet
  • Office Access 2003 Database

The CSV contains:

  1. Hex Code
  2. Language Code
  3. Language Description

The Spreadsheet and MDB Database contain:

  1. Hex Code (Key)
  2. Decimal Code
  3. Octal Code
  4. Language Code
  5. Language Description

 

Download: CSV, Excel 2003 and Access 2003 (22KB)

You may also be interested in my stores for ISO 3166-1 Country Codes.

Error: Activex componet can not create object: “WScript.Shell” when running WScript application

System Requirements:

  • Windows 95, 98, 98SE, Millennium
  • Windows NT 4.0, 2000, XP, 2003, Vista

The Problem:

When you run a .vbs file with a call to CreateObject(“WScript.Shell”) the script/application terminates with the follow error message:

ActiveX componet can not create object:”WScript.Shell”
Code: 800A01AD

The script then exits

More Information:

Your Windows Scripting Host has a mis-registered control. If you have just Installed Microsoft Internet Explorer <anything>.<anything> chances are the install went wrong. Check the install log in %SystemRoot% and check for failures.

I would recommend reinstalling IE properly to be safe, but chances are the problem will still be there afterward (it was with this particular muse and MSIE 7.0).

The fix is very simple however (assuming that your error is down to Windows Scripting Host and not bad programming; you are on your own on that one).

From cmd, or from a .bat run:

regsvr32 dispex.dll
regsvr32 jscript.dll
regsvr32 scrobj.dll
regsvr32 scrrun.dll
regsvr32 vbscript.dll
regsvr32 wshcon.dll
regsvr32 wshext.dll
regsvr32 wshom.ocx

I recommend that you start with wshom.ocx and test . No reboot is required for shell initiated .vbs files. If the problem is with IIS, you should restart the IIS Administrative and WWW services.

Be sure that you are using WScipt 5.6 (Unless running Vista or XP with IE7). You can download the latest release here:

Microsoft Access asks “Enter Parameter Value” when using the VB/VBA function FormatDateTime()

System Requirements:

  • Microsoft Access

The Problem:

When using an Integer based formatting value when calling the VB/VBA function FormatDateTime() as part of a statement in the Microsoft Access Expressions builder Access fails to process the function call correctly when attempting to preview the form or report. Instead,Access requests you enter a value for the variable ‘formatdatetime’ and ignores the correctly formatted function call as pictured below:

FormatDateTime Error

An example of the the function call which may produce this error would be:
FormatDateTime([database_record],4)

The above function call is designed to take the input date and time string and reformat the output to display only the time in a 24 hour clock format (vbShortTime). The integer value options are predefined as per the table below.

Constant Value Description
vbGeneralDate 0 Display a date in format mm/dd/yy. If the date parameter is Now(), it will also return the time, after the date
vbLongDate 1 Display a date using the long date format: weekday, month day, year
vbShortDate 2 Display a date using the short date format: like the default (mm/dd/yy)
vbLongTime 3 Display a time using the time format: hh:mm:ss PM/AM
vbShortTime 4 Display a time using the 24-hour format: hh:mm

The Fix:

This is an interesting one, because I haven’t conclusively been able to track down why it is doing it in this case. I have increasingly been seeing similar problems with integer based function parameter calls made to and by ADO and VB objects in ASP and VBA on completely unrelated, disparate systems on both workstations and servers and with different Windows/Office combinations on them.

While the error in the case of integer specification of the ADO cursor type .CursorType = i (where i = -1 through 3) is due to a mal-configured call to C:\Program Files\Common Files\System\ado\adojavas.inc, I have not managed to find a similar symptom for the formatdatetime issue outlined above.

There is a very simple fix however, don’t use the integer value, use the full format value string. So, the example of:
FormatDateTime([database_record],4) would instead become FormatDateTime([database_record],”hh:nn”)

The example of:
FormatDateTime([database_record],2) would become FormatDateTime([database_record],”mm/dd/yy”)

This should get you through the Access ‘error’ and force it to realise that you’re calling a VB function and not a private one.