custom asp/sql error message on missing sql table/field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omar999
    New Member
    • Mar 2010
    • 120

    #1

    custom asp/sql error message on missing sql table/field

    hi guys

    is it possible to have a custom asp/sql error message on a missing sql table/field?
    error msg e.g

    Microsoft OLE DB Provider for SQL Server error '80040e37'
    Invalid object name 'Hotel_Prices_2 010'.
    /.../...//...../....hiddenurl/etc//default.asp, line 101

    at the moment if there was a typo error in my code for a sql table or a sql field etc then the front end asp page errors - I just want a failsafe around this..

    thanks in advance
    Omar.
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    yes, in IIS you can specify which page is returned for each error code. right click on your website, select properties, and look for "custom error codes"

    Jared

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      you can also put error handlers right in the page:[code]
      'before section that might generate error
      on error resume next
      'after section that might throw error
      if err.number > 0 then
      response.write err.number
      end if[code]Jared

      Comment

      • omar999
        New Member
        • Mar 2010
        • 120

        #4
        thanks for the help guys

        I will give this a try
        Omar.

        Comment

        Working...