superslurpee
Programmer
- May 15, 2002
- 108
Hi,
I have a sub that uses ADO to get results from my database and display them. It works lovely. When I add "On Error Resume Next" at the top of the sub, and
at the bottom to just redirect the user to an 'error' page when a run-time error occurs (like database connection probs or whatever), I don't get the run-time error showing (that's good), but I don't get redirected either. It just sits and does nothing. It will work fine if there's no error, but when I add one, I don't get results, no error message, and no redirect.
Anyone have any ideas what's up? Am I doing this correctly? I want the thing to work like a try catch block. If an error is encountered, jump down and find how to deal with it.
Thanks peeps!
I have a sub that uses ADO to get results from my database and display them. It works lovely. When I add "On Error Resume Next" at the top of the sub, and
Code:
If Err.Number <> 0 Then
Response.Redirect "error.asp"
Err.Clear
End If
On Error GoTo 0
at the bottom to just redirect the user to an 'error' page when a run-time error occurs (like database connection probs or whatever), I don't get the run-time error showing (that's good), but I don't get redirected either. It just sits and does nothing. It will work fine if there's no error, but when I add one, I don't get results, no error message, and no redirect.
Anyone have any ideas what's up? Am I doing this correctly? I want the thing to work like a try catch block. If an error is encountered, jump down and find how to deal with it.
Thanks peeps!