How to use ASPError Object

Hi all,
I want to use ASPError Object in my asp page...

For that i opened IIS and go to the properties of my website. Then i press Custom Errors tab and edit the URL of 500;100 HTTP Error...
as /iisHelp/common/custom500.asp

where my custom500.asp includes--
<%
Dim objASPError
Set objASPError = Server.GetLastError()
Response.Write("ASPCode = " & objASPError.ASPCode)
Response.Write("ASPDescription = " & objASPError.ASPDescription)
Response.Write("Category = " & objASPError.Category)
Response.Write("Column = " & objASPError.Column)
Response.Write("Description = " & objASPError.Description)
Response.Write("File = " & objASPError.File)
Response.Write("Line = " & objASPError.Line)
Response.Write("Number = " & objASPError.Number)
Response.Write("Source = " & objASPError.Source)
objASPError.Clear
%>

now i create one asp page in my directory say error.asp which includes--
<%
dim strTest
strTest=1/0
%>

i just don't know how generate error on my Error.asp page......

i followed  the all the steps as mentioned in following URL
http://www.topxml.com/asp/asperror_object.asp

Pls help me out..

Regards,
Meenakshi Dhar
MeenakshiDharAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sajuksCommented:
Did you change the custom500.asp file ?
The best way to do it is create the custom500.asp in you root directory ( inetpub\wwwroot \)
In the error mapping properties change it to /custom500.asp instead of /iisHELp/common/custom500.asp,

teh error taht you're getting is cos its not able to find the file.
have a look at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q300043 .
0
sajuksCommented:
the file location of custom500.asp if it is under the folder /iisHelp/common/ should be
 %SystemRoot%\WinNT\Help\IISHelp\Common\custom500.asp. I assume that you'vnt created this file yet.
0
MeenakshiDharAuthor Commented:
ASP Error Object is introduced in ASP 3.0...how can i check the version of ASP...
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

MeenakshiDharAuthor Commented:
i m using WIN 2000 with IIS 5.0
0
MeenakshiDharAuthor Commented:
i have given this path
C:\WinNT\Help\IISHelp\Common\custom500.asp
but giving me an error  "not an absolute path"...

Regards,
Meenakshi Dhar
0
sajuksCommented:
No no you are doing it wrong.
I gave you two alternatives.
1> with reference to this http://www.topxml.com/asp/asperror_object.asp
did you place custom500.asp  in this location  C:\WinNT\Help\IISHelp\Common\
without changing the url as indicated in the link.Dont change the link. Place the file that you've created inside this folder.

" i have given this path
C:\WinNT\Help\IISHelp\Common\custom500.asp
but giving me an error  "not an absolute path"..."
Dont change the path let it be as it is in the url taht you posted. Have you placed custom500.asp in this location
C:\WinNT\Help\IISHelp\Common\ ??
0
sajuksCommented:
2> Change url to  /custom500.asp and save the  custom500.asp fiel in your wwwroot directory.
You shouldnot /cannot give the physical path like c:\innetpub\wwwroot it should always be the relative path
0
MeenakshiDharAuthor Commented:
still not working...
what i did is...

my root folder is c:\Inetpub\wwwroot\Test
i changed URL to /custom500.asp and put custom500.asp file in 'Test'  folder...but not getting any error...showing me blank page...

Regards,
Meenakshi Dhar
0
MeenakshiDharAuthor Commented:
i think the problem is with ASP version...not sure abt this...

Regards,
Meenakshi Dhar
0
sajuksCommented:
If you use http://support.microsoft.com/default.aspx?scid=kb;EN-US;q300043
are you able to trap the errors ?
0
MeenakshiDharAuthor Commented:
ya i m able to track errors using this...but if i want to know the line number at which error occurs then that thingcan be done only using ASPError Object...
0
sajuksCommented:
Which IIS version are you usning ?
0
MeenakshiDharAuthor Commented:
IIS 5.0
0
MeenakshiDharAuthor Commented:
can u pls tell me how to chk the version of IIS...
0
sajuksCommented:
Lets start from the beginning itself. We'll take http://www.topxml.com/asp/asperror_object.asp as reference
Follow the steps exactly as ishown in the example.Dont change a single thing.
Next save the  custom500.asp file to
 %SystemRoot%\WinNT\Help\IISHelp\Common\custom500.asp

Once thats done save the error page at the root istelf.
<%
           dim myvar
            myvar = 1/0    

%>
ie at c:\Inetpub\wwwroot\myerrorpage.asp
Do you get a blanl page or are you able to see the error.Restart iis before testing.
0
MeenakshiDharAuthor Commented:
whenever i m saving my custom500.asp file at this location,

%SystemRoot%\WinNT\Help\IISHelp\Common\custom500.asp
i.e. C:\WinNT\Help\IISHelp\Common\custom500.asp

i m not able to save it as it gives an error message as --
"The path is not a local absolute URL Path.."



0
sajuksCommented:
http://localhost/iisHelp/  should give you the version info.Check the info page.

Or you could
<%
Response.Write ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion
%>

or from explorer  right click on asp.dll and check the properties.

ASP 2 for windows NT
ASP 3 is only for Windows 2000
0
sajuksCommented:
Are you saying you are not able to save in the url ?
The format is /IISHelp/Common\custom500.asp as shown in the page and not
C:\WinNT\Help\IISHelp\Common\custom500.asp
0
MeenakshiDharAuthor Commented:
The vesrion is 5.6.7426..
and in URL i m entering "/IISHelp/Common\custom500.asp" only..
but still showing me blank page...
0
sajuksCommented:
/IISHelp/Common/custom500.asp and not /IISHelp/Common\custom500.asp
0
MeenakshiDharAuthor Commented:
ya i have done "IISHelp/Common/custom500.asp" ...
but still shows me blank page...
0
sajuksCommented:
i hope you meant /IISHelp/Common/custom500.asp  and not IISHelp/Common/custom500.asp :-)
Try renaming custom500.asp to something else.
Where is your errorasp page locn ? Did you restart iis before checking. Clear temp internet files too for good measure.
0
MeenakshiDharAuthor Commented:
yes i did everything...but no luck!!!!...my errorasp page is located at
C:/Intepub/wwwroot/errorpage.asp
0
sajuksCommented:
Are you getting a blank page or a page not found error ?
Try adding some lines of code Response.Write "Hello" to check whether the page is the rite one thats getting loaded.
0
MeenakshiDharAuthor Commented:
its not showing me any error...rest of the page is fine...if i added this code--Response.Write "Hello"..that it is displaying...
0
sajuksCommented:
this is my errorhandle.asp page
<%@ Language=VBScript %>
<%

            dim myvar
            myvar = 1/0    

%>

this is my  custom500.asp
<%
            Dim objASPError
            Set objASPError = Server.GetLastError
            Response.Write("ASPCode = " & objASPError.ASPCode)
            Response.Write("ASPDescription = " & objASPError.ASPDescription)
            Response.Write("Category = " & objASPError.Category)
            Response.Write("Column = " & objASPError.Column)
            Response.Write("Description = " & objASPError.Description)
            Response.Write("File = " & objASPError.File)
            Response.Write("Line = " & objASPError.Line)
            Response.Write("Number = " & objASPError.Number)
            Response.Write("Source = " & objASPError.Source)

%>
both files are located at c:\inetpub\wwwroot.

For 500:100 i've the url as /custom500.asp

If i run the page i get an error
ASPCode = ASPDescription = Category = Microsoft VBScript runtime Column = -1Description = Division by zeroFile = /errorhandle.aspLine = 5Number = -2146828277Source =
0
MeenakshiDharAuthor Commented:
i m using Visual Interdev 6.0...
it's not showing me  Server.GetLastError in dropdowm menu...
0
sajuksCommented:
I've not worked with  Visual Interdev , i prefer editplus( or notepad ) for this. Just confirm that your errorhandle page
looks like this
<%@ Language=VBScript %>
<%

            dim myvar
            myvar = 1/0    

%>
and nothing else .
0
MeenakshiDharAuthor Commented:
i have done the same thing which u mentioned above..but same blank page...i just don't know where exactly is the problem...i m using windows 2000 professional...
0
sajuksCommented:
Server needs to be  Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Since you've 2000 proffsnl its a no go. Check in m/c where you've either Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
The client machine can be Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.
Thats y you are not seeing the error
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MeenakshiDharAuthor Commented:
ok...thx a lot sanjuks for ur help...i need to chk this one now...
0
sajuksCommented:
Thanks for the points and grade.
Shoud've asked for your OS initially itself,my bad.Could've avoided so many posts :-)
and its sajuks and not sanjuks  ;-)
0
MeenakshiDharAuthor Commented:
ok sajuks...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.