Microsoft KB Archive/275519

= PRB: Global.asa Reports &quot;Element Not Found&quot; Error =

Article ID: 275519

Article Last Modified on 5/8/2001

-

APPLIES TO


 * Microsoft Active Server Pages 4.0

-



This article was previously published under Q275519



SYMPTOMS
When you use the Active Server Pages (ASP) Request.ServerVariables collection in the Application events defined in the Global.asa file, you may receive the following error message:

(0x8002802B)

Element not found.

global.asa, line xx

NOTE: In the error message above, xx varies depending on how the code has been written.



CAUSE
The Request.ServerVariables collection is not available in the Application events of the Global.asa file. The Application events include the Application_OnStart and the Application_OnEnd procedures.



RESOLUTION
To work around this issue, access the Request.ServerVariables collection in the Session events of the Global.asa file. The Session events include the Session_OnStart and the Session_OnEnd procedures. To make your code run only when the application starts or ends, you can add the following code to the Global.asa file:  Sub Application_OnStart Application(&quot;txtOnStart&quot;) = true End Sub

Sub Session_OnStart if Application(&quot;txtOnStart&quot;) = true then Application(&quot;txtPathInfo&quot;) = Request.ServerVariables(&quot;PATH_INFO&quot;) Application(&quot;txtInstanceId&quot;) = Request.ServerVariables(&quot;INSTANCE_ID&quot;) Application(&quot;txtOnStart&quot;) = false end if End Sub 



Steps to Reproduce Behavior
To reproduce this behavior, add the following code to the Global.asa file:

 Sub Application_OnStart Application(&quot;txtPathInfo&quot;) = Request.ServerVariables(&quot;PATH_INFO&quot;) End Sub 

Additional query words: 0x8002802B

Keywords: kbscript kbcodesnippet kbaspobj kbprb KB275519

-

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

© Microsoft Corporation. All rights reserved.