Microsoft KB Archive/257625

= Error message: HTTP: 500-100, Internal Server Error - ASP Error... Undefined Variable =

Article ID: 257625

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q257625



SYMPTOMS
When you attempt to browse an ASP Web page, the following error messages are displayed in the browser:

The page cannot be displayed

There is a problem with the page you are trying to reach and it cannot be displayed.

HTTP 500.100 - Internal Server Error - ASP error

Internet Information Services

In addition, information similar to the following is displayed under the Technical Information (for support personnel) section:

Error Type:

Microsoft VBScript runtime (0x800A01F4)

Variable is undefined: 'x'

/OptionExplicitError.asp, line 9

Page:

GET /OptionExplicitError.asp



CAUSE
When you use Visual Basic, Scripting Edition, the Option Explicit statement is specified in the script of the ASP file. Subsequently, the script attempts to use an undeclared variable.



RESOLUTION
To resolve this issue, either remove the Option Explicit statement or declare the variable (using the DIM keyword).



Steps to reproduce the behavior
To reproduce this behavior, run an ASP file that contains the following code (in a virtual directory that permits script execution): <% Option Explicit %>   500-100 Undeclared Variable   About to use an undeclared variable <%  x = 5 %>   </HTML> To fix the example above, declare the X variable using the DIM statement, which is demonstrated as follows: <% Option Explicit %> <HTML>  500-100 Undeclared Variable</TITLE> </HEAD>  About to use an undeclared variable</P> <%  DIM x  x = 5 %> </B></P> </BODY> </HTML>

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Kevin Zollman, Microsoft Corporation.

Additional query words: IIS 5 500100 500-100 500;100 undefined vbs vbscript debug active script pages akz

Keywords: kbhttp500100 kbprb kbprod2web KB257625

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.