Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create ASP Error Pages

Status
Not open for further replies.

Silvinho

Programmer
Jul 9, 2001
58
GB
IS it possible to create your own ASP error pages instead of using the generic ones such as :

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index etc.......


As each error has its own code number i would have thought this was possible.
 
If you are using IIS 4, you will need to include your own error handling code.

set db = server.createobject("ADODB.connection")
db.Open(ConnectionString)
SQL = "update mytable set key = " & duplicate_key

'turn on error handling
on error resume next
db.execute sql

'handle error
if err.number then
select case err.number
case '80040e14':
response.write "That key already exists!"
case else
response.write &quot;An unexpected error occured<BR>&quot;
response.write err.number & &quot;<BR>&quot; err.description
end select
end if

'turn off error handling
on error goto 0

.
.. Eat, think and be merry .
... ....................... .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top