Record does not exist refresh code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blue10
    New Member
    • Jun 2007
    • 4

    Record does not exist refresh code

    Hi, I'm new.
    Many of my old pages get listed on search engines, but once the record they call is deleted the page is no longer available.
    I was wondering if there was some ASP code for where a record doesn't exist, the browser is refreshed to another page please?
    Blue10
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Blue,

    I believe this is usually done via a server setting. I was recently brushing up on Apache and I came across those options. I can't remember how to do it in IIS.

    If the script still exists (but the script then tries to open a db record for example which has been deleted), say mySite.com/productInfo.asp ?record=293 but product 293 no longer exists then productInfo.asp can definitely handle that. For example, if productInfo.asp opens a db and searches for record 293 it will get "EOF" (end of file) so you can handle this as follows:

    Code:
    if rs.EOF then
       response.redirect "productMissing.asp"
    end if
    Let me know if this helps.

    Jared

    Comment

    • Blue10
      New Member
      • Jun 2007
      • 4

      #3
      Did it help?
      Man you are a genius! Thank you so much.
      Blue

      Comment

      Working...