On Error Go To Page

Results 1 to 6 of 6

Thread: On Error Go To Page

  1. #1
    Jeff Kovach Guest

    Default On Error Go To Page

    My asp pages get data from a database and uses varaibles to retrieve the records. The browser address looks like .../jobs.asp?type=c. The problem is if the user manually types in the address bar and makes a mistake like .../jobs.asp?type=b. There is no "b" type of jobs so they get an error which reads, "Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e0c&#039;Command text was not set for the command object. <BR>/webpub/JobReq/jobs.asp, line 364".<BR><BR>Q: Is there any way to redirect the user to another html page or asp page if there is ANY ERROR on the page whether database error, connect error, etc.? That way I can work on debugging each page but, in the meantime, give them a generic error page so they can go back and check there input.<BR><BR>I like using VBScript.<BR><BR>Thanks,<BR>Jeff Kovach

  2. #2
    Alex T. Guest

    Default RE: On Error Go To Page

    Try something like this maybe?<BR><BR>&#060;%If rstemp.EOF Then%&#062;<BR><BR>&#060;% Response.Redirect "ErrorPage.asp"%&#062;<BR><BR>&#060;%Else%&#062;<B R><BR>Display your information here<BR><BR><BR>You could also maybe just type an error message in where the Responese.Redirect is.

  3. #3
    Alan Newton Guest

    Default Yep, i'm looking for this, too...

    See &#039;another easy one...&#039; below...

  4. #4
    Eddie Campbell Guest

    Default RE: On Error Go To Page

    Yes, do this<BR><BR>On error Resume next<BR>... The lines where the error *might* occur<BR>If Err &#060;&#062; 0 then<BR>Response.redirect "MyerrorPage?Error=" & Err.Description<BR>End if<BR>On Error Goto 0 &#039; Turn off error handling

  5. #5
    Jeff Kovach Guest

    Default RE: On Error Go To Page

    Sorry Guys for asking this question in the wrong place but I just have to know.<BR><BR>If this is Eddie Campbell responding to this message, did you go to Whitmer High School way back when...? I knew an Eddie Campbell, but I&#039;m sure there are a few dozen in this world!<BR><BR>Thanks for your help also,<BR>Jeff Kovach

  6. #6
    Eddie Campbell Guest

    Default Sorry, wrong Eddie Campbell

    I went to quite a few schools, but none called Whitmer High

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts