You may receive an "ASP 0126" error message when you try to view an ASP Web page that is hosted in IIS 6

Article translations Article translations
Article ID: 920721 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

Consider the following scenario. In Microsoft Internet Information Services (IIS) 6, you create a virtual directory that is named Samples. The Samples virtual directory contains a subfolder that is named Includes. The Includes folder contains a subfolder that is named Files. The Includes folder contains a Microsoft Active Server Pages (ASP) Web page that is named Date.asp. The Files subfolder contains an ASP Web page that is named Test.asp. In the Test.asp Web page, you use an #include statement to insert the contents of the Date.asp Web page into the Test.asp Web page.

In this scenario, you may receive an error message that resembles the following when you try to view the Test.asp Web page:
Active Server Pages error 'ASP 0126'

Include file not found

CAUSE

This issue occurs if the Test.asp Web page contains the #include virtual statement with a relative file path.

WORKAROUND

To work around this issue, use one of the following methods.

Method 1: Use the #include virtual statement together with an absolute file path

To work around this issue, use the #include virtual statement together with an absolute file path in the Test.asp Web page. Consider the following code examples:
  • The following line of code does not work.
    <!-- #include virtual ="../Date.asp" -->
  • The follow line of code works.
    <!-- #include virtual ="Samples/Includes/Date.asp" -->

Method 2: Use the #include file statement together with a relative file path

To work around this issue, use the #include file statement together with a relative file path in the Test.asp Web page. Consider the following code samples:
  • The following line of code does not work.
    <!-- #include virtual ="../Date.asp" -->
  • The following line of code does work.
    <!-- #include file ="..\Date.asp -->
Note By default, parent paths are disabled in IIS 6. To enable parent paths, you must manually set the AspEnableParentPaths property in the metabase to TRUE.

STATUS

This behavior is by design.

Properties

Article ID: 920721 - Last Review: November 22, 2007 - Revision: 1.2
APPLIES TO
  • Microsoft Internet Information Services 6.0
Keywords: 
kbtshoot kbprb kbcode KB920721

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com