473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Prevent any type of error...

How can you prevent the database error from displaying on
screen? Can you redirect users to a more friendly error
screen that is custom created. Using ASP/SQL Server. For
instance, if the database cannot be found, instead of
displaying,

Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not
exist or access
denied.
/myConn.asp, line 7

Can you make it to where you could display something like
this:

"I'm sorry, a database error has occured, please try your
request later, click hyperlink for list of possibilities."

Mike

Jul 19 '05 #1
2 1338
Hello Mike,

There is the On Error Resume Next option and there is the option to create a
cutom 500 page (the default is that "Internal Server Error").

http://msdn.microsoft.com/library/en...stmonerror.asp

This article explains how to create a custom 500 page, although it's not its
main focus.
http://www.aspfaq.com/show.asp?id=2335

Also, this article, while it's dealing with custom 404s, can also be applied
to 500 errors, although you don't need to grab the url out of the
querystring.
http://www.aspfaq.com/show.asp?id=2162

Ray at work
"Mike" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
How can you prevent the database error from displaying on
screen? Can you redirect users to a more friendly error
screen that is custom created. Using ASP/SQL Server. For
instance, if the database cannot be found, instead of
displaying,

Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not
exist or access
denied.
/myConn.asp, line 7

Can you make it to where you could display something like
this:

"I'm sorry, a database error has occured, please try your
request later, click hyperlink for list of possibilities."

Mike

Jul 19 '05 #2
on error resume next
conn.open "connection string"
if err.number <> 0 then
response.write "I'm sorry ... "
else
' ... work with database ...
end if

Another novel idea is testing your connection string before putting it live
on your site, and getting a provider where you can rely on your database
being up 24 x 7.

I know, pot, kettle, and all that. I'm working on a deal with a new
provider.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Mike" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
How can you prevent the database error from displaying on
screen? Can you redirect users to a more friendly error
screen that is custom created. Using ASP/SQL Server. For
instance, if the database cannot be found, instead of
displaying,

Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not
exist or access
denied.
/myConn.asp, line 7

Can you make it to where you could display something like
this:

"I'm sorry, a database error has occured, please try your
request later, click hyperlink for list of possibilities."

Mike

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mike | last post by:
How do I prevent SQL Server 2000 from posting successful backup completion messages to the Windows 2000 Application Event Log? I have scheduled jobs which backup my transaction logs on 50+...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
3
by: Damian | last post by:
Hi everyone I'm having an issue with one of our applications. I'm getting the following error when attempting to log in to the site: Server Error in 'xxxxxxxxxxxxxxxx' Application....
6
by: Divya | last post by:
Hi, I have a web page which generates a CSV file based on some user input. When this file is downloaded by the user, the file is being automatically converted to .xls. Any idea how I can prevent...
13
by: Perecli Manole | last post by:
In the forms authentication construct, I need a way to prevent ticket IssueDate and Expiration from being updated for a specific page only. By default forms authentication updates these two values...
9
by: Larry Woods | last post by:
I have a method in my base class that I want ALL derived classes to use. But, I find that I can create a "Shadow" method in my derived class that "overrides" the method in my base class. Can't...
14
by: Ed Jay | last post by:
On a multi-textbox form, linked to an external js, I use onBlur to call: function chkNum(cellname) { var str = document.getElementById(cellname).value.toString(10); if (str < 28 || str > 36)...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
4
by: since | last post by:
How do I in IE prevent the onclick action from being fired when I am done dragging? have tried "window.event.cancelBubble = true", for onmouseup , onmousedown, and onmousemove handlers. The onclick...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.