classic asp response.write error
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads asp on error goto with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack asp on error goto 0 Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign asp error number up IIS 6.0, Classic ASP Detailed Error Message up vote 8 down vote favorite 2 I have a legacy classic asp site which is moved from IIS 7 to IIS 6. Unfortunately I am getting an error in my application but
Asperror Objectits not sending any detailed error information to the browser so I am not able to correct it. The Server throws an custom error message as follows; Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error. More information about this error may be available in the server error log. classic asp throw exception how can i get a the error info as in IIS 5.5? Thanks in advance asp-classic iis-6 share|improve this question asked Mar 31 '12 at 5:09 Libin TK 6111828 Open the site in a browser from the server. –Nathan Rice Mar 31 '12 at 5:12 its a share hosting.. i can't access the server's browser –Libin TK Mar 31 '12 at 5:17 add a comment| 2 Answers 2 active oldest votes up vote 12 down vote accepted If you can't change the IIS error settings then simply let the asp-page print the error. At the top of the file, set On Error Resume Next to allow the asp-script to continue executing despite any errors. Then at the possible locations where you suspect error to occur OR just at the bottom of the page; put this code. IF Err.Number <> 0 THEN Response.Write "=========================================" & "
" Response.Write "Error description: " & Err.Description & "
" Response.Write "Source: " & Err.Source & "
" Response.Write "LineNumber: " & Err.Line & "
" Response.Write "=========================================" & "
" END IF share|improve this answer edited May 19 '14 at 7:46 answered Mar 31 '12 at 12:45 David 9841428 hi @David I did use your way and got the error description saying overflow - but the line number is not showing - can you please let me know what else can I do to get the line number ? –marifrahman Nov 1 '13 at 0:09 a
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn an error occurred on the server when processing the url please contact the system administrator more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
On Error Resume Next VbscriptUsers Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Debugging with Response.Write in classic ASP up vote 10 down vote favorite 7 I am trying to debug some code using Response.Write, but when I run http://stackoverflow.com/questions/9953198/iis-6-0-classic-asp-detailed-error-message the code it skips over that statement and errors out at some point further in the code. How can I get my Response.Write statements to show without the other errors coming up? asp-classic share|improve this question edited Jan 15 '10 at 21:50 p.campbell 55.9k49187270 asked Jan 14 '10 at 3:53 chobo 9,5982387157 add a comment| 7 Answers 7 active oldest votes up vote 9 down vote accepted I quite frequently use Response.End when I have to see http://stackoverflow.com/questions/2062058/debugging-with-response-write-in-classic-asp a status in a certain place on a page. share|improve this answer edited Jan 27 '10 at 0:18 Eduardo Molteni 28.3k18104181 answered Jan 15 '10 at 21:46 bjorsig 7242517 add a comment| up vote 10 down vote We utilize Visual Studio 2008 to debug classic asp pages. You can attach to the IIS process and "step through" the page. Its very sweet. Here are the steps: Get latest of the classic ASP from source control. Install IIS (if not already). FYI... I am using IIS 5.1. Create a virtual directory called "classicDebug" pointing to your local directory (C:\Websites\ClassicWebSite). View the virtual directory properties, Virtual Directory tab. Enable the "Script source access" checkbox. Configuration button, Options tab - check everything. Debugging tab - check everything. 7a. In the ASP.NET tab, select 2.x Load up (not run or debug or F5) the website in VS.NET 2008. Edit your global.asa accordingly (data sources, and paths). Find the .asp page you want to "step through" and set a break point at the top (or somewhere). Open IE, and navigate to your page. Go back to VS.NET and select Debug -> Attach to Process Check "show processes from all users" and select the process. For me (IIS 5.1), the process name is dllhost.exe running with the IWAM_COMPUTERNAME account w/type "Script, T-SQL, Managed, x86". Visit your page using IE... VS.NET should break. share|improve
Tutorials MSDN Communities Hub Official Docs Security Stump the SQL Guru! XML Info Information: Feedback Author an Article Published: Monday, February 12, 2001 Generating Sensible Error Messages Using Err.Raise By Zack Jones Okay, I'll admit it, if there's one area where my ASP scripts are lacking: it's in the area of error checking. I've looked at the Err object included with VBScript but have been really frustrated with it's seemingly lack of information. (For more information on the Err object be sure to read: Error Handling in ASP!) Consider this snippet of code:
<% Option Explicit Dim Conn Dim strSQL Set Conn = Server.CreateObject("ADODB.Connection") 'this DSN does not exist Conn.Open "foo" '...If you run the above script (without having a DSN named foo created) you'll get the following error: Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/dmsms/etest.asp, line 6 Fine, I can deal with that. While the error message is anything but pretty or profoundly descriptive, I do know that I need to fix something that's wrong on line 6 of the script. So I'll load it into the editor, fix it and then try running it again. If needed I'll repeat this cycle until I have a script that works. Now consider a script like this one that has Error checking turned on:
<% Option Explicit On Error Resume Next Dim Conn Dim strSQL Set Conn = Server.CreateObject("ADODB.Connection") 'this DSN does not exist Conn.Open "foo" '... more code ... If Err.Number <> 0 then Response.Write("Error Number -> " & Err.Number) Response.write("Viewing the above script through your browser will produce the following output: Error Number -> -2147467259
Error Source -> " & Err.Source) Response.Write("
Error Desc -> " & Err.Description) Err.Clear End If %>
Error Source -> Microsoft OLE DB Provider for ODBC Drivers
Error Desc -> [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified To me this information is less useful than the default error message. At least with the default error message I know the line on which the error originated. Recently I was having yet another look at the Err object and I stumbled upon something that I've overlooked many times in the past. You can raise your own errors! The Err object contains a Raise method that does exactly this. The Raise method has the following synt