Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Err.Number Problem

Status
Not open for further replies.

GP1

Programmer
Jan 15, 2002
23
0
0
NO
Hi
Please take a look at the code given bellow. I print the err.number twice. But inside the if condition when I print I get err.number as zero. But before going to the if when I print the err.number I get an error code. What do you think ?

Thanks,
Gavin


'Gavin
Response.Write(&quot;Err.Number : &quot; & Err.Number & &quot;<br>&quot;)
Response.Write(&quot;Err.Description : &quot; & Err.Description & &quot;<br>&quot;)
Response.write( &quot;If Not Err.Number = 0 Then....&quot; ) & (Not Err.Number = 0) & &quot;<br/>&quot;
'END Gavin

' Again check for possible errors
If Not Err.Number = 0 Then
' Attempt to write debug log
DebugLog &quot; - Folder.inc; SetDiscussion: Error getting folder. Error: &quot; & Err.Number & &quot; &quot; & Err.Description

'Gavin
Response.write( &quot;Big problem....&quot; ) & &quot;<br/>&quot;
Response.Write(&quot;Err.Number : &quot; & Err.Number & &quot;<br>&quot;)
Response.Write(&quot;Err.Description : &quot; & Err.Description & &quot;<br>&quot;)
'END Gavin

' Display error message
Response.Write(bstrFolderID & &quot;<br>&quot;)
Response.Write(Err.Number & &quot;: &quot; & Err.Description & &quot;<br>&quot;)
Response.End
End If



 
Hi,

Every time you use the error object, you need to include this line at the top of the ASP page: ON ERROR RESUME NEXT

After every use of the error object, before using it again you need to clear the error object with Err.Clear()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top