Trapping the HTTP Error Numbers...

Burnard
05-21-2002, 10:36 AM
I have searched through the avaliable posts on this forum, and unfortunetaly there is nothing that helps with my situation.

My scenario is that I need to find the HTTP Error number, i.e. 400, then I can specify a SQL query that will select certain data from a database for a custom error page. The thing is I need to be able to do this in ASP and not in my usual VB!!

Any help would be gratefully received....

Cheers
Burnard

Thinker
05-21-2002, 10:46 AM
You have to configure this in IIS. It is on the Custom Errors tab of
the web site properties.

Burnard
05-21-2002, 10:57 AM
I have gone through that, and I have looked at using seperate pages for each error message, but what I want to use is just one page, with code in there that will extract data from a SQL server db.

Will I have to configure this in the properties or not?

Burnard
05-21-2002, 11:04 AM
I have managed to specific one file, using the "URL" option in the "Custom Errors" option within "Properties", however, it is the code within that one ASP document that I need help with.

I just need to know, whether it is a ServerVariable, or not and is not, what it is that will display the Error Code.....

Thinker
05-21-2002, 11:05 AM
I understand now. There is no guarantee this will work, but you
can try...

dim ASPErr
Set ASPErr = Server.GetLastError
If ASPErr.ASPCode = 400 Then...

The ASP book I have says this is supposed to work, but many
times doesn't. I hope it does for you.

Burnard
05-21-2002, 11:08 AM
Cheers Thinker, "me old china"! I shall try it and hopefully it will work!! I shall let you know....

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum