Forum Moderators: open

Message Too Old, No Replies

ASP Error trapping

Try/Catch not working

         

HeadBut

3:09 pm on Oct 14, 2004 (gmt 0)

10+ Year Member



I just want to catch the errors from a sign-in query:
Set TrySignIn = MyConn.Execute(SQL_QUERY)

The Query works good but the try and catch are not working:

Try
Set TrySignIn = MyConn.Execute(SQL_QUERY)
Catch
ErrorCooking = Err.Description
ExitTry
Finally
ErrorCooking = "No Trap Error."
EndTry

I don't have access to the seerver and the admin is often away or out of town... any suggestions for the try/catch methodology?

Thanks

mattglet

4:54 pm on Oct 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is no Try/Catch in classic ASP. Try this:

on error resume next
Set TrySignIn = MyConn.Execute(SQL_QUERY)

if err.number <> 0 then
ErrorCooking = Err.Description
end if

on error goto 0

plumsauce

12:00 am on Oct 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




There is try/catch in asp, when the scripting language is jscript.