Counting / Identifying Errors (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


SerenityNet -> Counting / Identifying Errors (2/4/2005 5:17:05)

As an example, I use the following to return active session variables.
<%
 on error resume next
 for x = 0 to session.Contents.Count-1
    Response.Write "<nobr><pre><b>"
    Response.write session.Contents.key(x) & " - </b>"
    Response.write session.Contents.item(x) &  "</nobr><p><br>"
 next
%>


I've found, for some reason I can't figure out, that I sometimes get an error.
Microsoft VBScript runtime error '800a01b6' 
Object doesn't support this property or method 
/variables.asp, line 91

Where line 91 is
Response.Write "<tr><td>" & strName & "</td><td>" & Session.Contents(strName) & "</td></tr>"


So two questions:

1)  When an error is encountered in the loop, how can I catch it and report it? Something like response.write "error"

2)  Any idea on what the error could be?

Thanks,
Andrew




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875