Microsoft Knowledge Base Email Alertz

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

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 920721 - Last Review: November 22, 2007 - Revision: 1.2

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

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.

APPLIES TO
  • Microsoft Internet Information Services 6.0
Keywords: 
kbtshoot kbprb kbcode KB920721
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Theo Hubenet - t.hubenet NOSPAM-AT-NOSPAM vakantiegevoel.nl Report As Irrelevant  
Written: 3/1/2007 1:51 AM
The #include file asp 0126 error is a problem many people are having and it reoccurs periodically so I use the following instead: set fs = Server.CreateObject("Scripting.FileSystemObject") set content = fs.OpenTextFile("D:\wwwhtml\hoogenboom\Data\eigenaren\mijngegevens\10002113.txt",1) response.write content.readall

Anonymous User Report As Irrelevant  
Written: 1/1/2008 11:03 PM
Is this problem applicable to IIS version 5 also?