Skip to main content
January 15, 2010
Answered

Catching Timeout Database errors?

  • January 15, 2010
  • 1 reply
  • 618 views

Occasionally, when the database on my host server is slow, people will get the following error.

Microsoft OLE DB Provider for SQL Server error '80040e31'  Timeout expired  /searchresults.asp, line 54

It destroys the page and the only thing on the page is the above error. This is really something I'd like to avoid. I would rather have a page that would appear that would appologize to the customer, tell them to come back at a later date and contact tech support to tell us about is.

So basically, if it runs into this, I would like it to either refresh to an error page or display the page without the database content and show the tech support content that was hidden with an if statement.

I suspect the solution for this is a server solution and if the server gets this error, it displays a page.

The site runs on IIS 7 with a MS-SQL 2008 database. Classic ASP (VBscript).

This topic has been closed for replies.
Correct answer bregent

Classic ASP error handling is not very full featured, but you can do it. You need to use the On Error Resume Next statement:

http://www.aspdev.org/articles/asp-error-handling/

1 reply

bregentCorrect answer
Participating Frequently
January 15, 2010

Classic ASP error handling is not very full featured, but you can do it. You need to use the On Error Resume Next statement:

http://www.aspdev.org/articles/asp-error-handling/