PDA

View Full Version : ASP custom error page


lanvan
02-13-2005, 05:51 PM
I have an asp page that writes to an .mdb (database) with the primary key set to the email field to avoid duplicate entrys. If a duplicate entry is input it returns the default error.

Microsoft JET Database Engine error '80004005'

The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

/db/capture.asp, line 11

How can I redirct the page to a custom error page(HTML page)? If a duplicate entry is input.

Does this make any sense? 18 views and no response.

miranda
02-14-2005, 05:23 AM
one way of handling errors in ASP 3.0 is done like so

If err.Number <> 0 Then
Response.Redirect "customError.asp?error=" & err.Number
End If