ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rating: Thread Rating: 3 votes, 3.33 average. Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #16  
Old August 16th, 2005, 02:28 AM
slunk slunk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Location: wales
Posts: 17 slunk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 9 sec
Reputation Power: 0
Send a message via MSN to slunk
response.write rocks

I agree with all but using IDE debuggers is just faffy. Using is response.write with a .end as well rules.

I guess though it does depend on the size of your app.

good discussion. cheers dudes.

Reply With Quote
  #17  
Old September 2nd, 2005, 08:25 AM
fbtlopes fbtlopes is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 1 fbtlopes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 17 sec
Reputation Power: 0
Multiple Errors

When an asp page got an error it’s created an Err object, that returns the error, its description, etc. Like Err.Number, Err.Description…. right?

But that only returns the last occurred error and I wish to get all the occurred errors on the page and not only the last one.

Anyone knows how to do it?



Thanks in advance

Reply With Quote
  #18  
Old October 8th, 2005, 02:21 AM
mickey_in mickey_in is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 9 mickey_in User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 8 m 41 sec
Reputation Power: 0
Phoenix can u post a link which explain the method u have discussed with us.

Thanks.

Reply With Quote
  #19  
Old October 8th, 2005, 03:25 AM
PhilCollins99's Avatar
PhilCollins99 PhilCollins99 is offline
The Constant Student
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Location: England
Posts: 913 PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level)PhilCollins99 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 5 h 40 m 9 sec
Reputation Power: 27
It would be great if someone could post a simple step by step approach to configure Visual Studio to be used as a debugger for ASP pages whilst stepping through an ASP page line by line. i.e. As you can when you create a visual basic program and press F8 to enter and step line by line.

I suspect this isn't too easy to explain nor easy to set up but if someone has the time that would be extremely helpful.

__________________
- Post your code
- Post your errors
- Be clear
- Be courteous
PLEASE...Finalise your thread with a solution or confirmation that the last advice worked or failed (We are here to help each other).

Reply With Quote
  #20  
Old October 8th, 2005, 05:43 AM
Phoenix's Avatar
Phoenix Phoenix is offline
Web-Standards Evangelist
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Posts: 1,522 Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 48 m 4 sec
Reputation Power: 8
Just ensure the IIS worker process holding the ASP page is currently running, open up the script in VS and attach to the worker process via Debug > Processes > %computerName% > %workerProcessNameForYourOs%

The running script should then appear in the "Running Documents" pallete.

Reply With Quote
  #21  
Old October 28th, 2005, 09:51 AM
Phoenix_riser Phoenix_riser is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 225 Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level)Phoenix_riser User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 2 h 28 m 15 sec
Reputation Power: 14
Quote:
Originally Posted by Phoenix
Just ensure the IIS worker process holding the ASP page is currently running, open up the script in VS and attach to the worker process via Debug > Processes > %computerName% > %workerProcessNameForYourOs%

The running script should then appear in the "Running Documents" pallete.


One thing we did in Javascript at uni was to have if error <> 0 Then...
If Verror <> xyz then...
go to error handler

Set Verror at the top in a css or include file so you can test the whole site. When finished simple change Verror to something other than xyz and it will not show up!

Reply With Quote
  #22  
Old December 12th, 2005, 06:07 AM
HELP_SARA HELP_SARA is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 1 HELP_SARA User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 47 sec
Reputation Power: 0
hello people. im new to this forum and im a first time user of ASP. im finding so many problems with the programming. firstly, i keep getting system error messages wen the debugging begins and over 100 erros occur. i have used html in coding which works until it is debugged. plzzz help any1

Reply With Quote
  #23  
Old December 12th, 2005, 06:23 AM
elijathegold's Avatar
elijathegold elijathegold is offline
Senior Fire Wizard
Click here for more information
 
Join Date: Feb 2005
Location: Ashford, Kent. England
Posts: 5,651 elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1488539 Folding Title: Super Ultimate Folder - Level 3
Time spent in forums: 2 Months 2 Weeks 2 Days 3 h 57 m 17 sec
Reputation Power: 301
Quote:
Originally Posted by HELP_SARA
hello people. im new to this forum and im a first time user of ASP. im finding so many problems with the programming. firstly, i keep getting system error messages wen the debugging begins and over 100 erros occur. i have used html in coding which works until it is debugged. plzzz help any1


First of all welcome to the forum....

If you want to get help with your coding, can you post a new
thread, rather than replying to this one as it is a completely new
topic.

Typically we need to see various things and if they are not there,
we will waste time asking for them

We need to know what you are trying to do,
We need to know what is actually happening.
We need to see the code that you are running - please
enclose it in blocks as it is a lot
easier to read.
Please also give us an exact error message and shown in your
code, the line where it is occuring.
__________________
And he picked it all up... in his pick-up.





Friends of Shemzilla

Reply With Quote
  #24  
Old January 20th, 2006, 08:24 AM
minus4's Avatar
minus4 minus4 is offline
short arse brainiac
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Leeds UK
Posts: 573 minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)  Folding Points: 800 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 22 m 36 sec
Reputation Power: 30
Send a message via MSN to minus4
i find that most errors, apart from basics are from database related.

now the best way to handle all database is to have a function for each database routine. ie connection, recordset, insert, updating, deleting etc.

now below is some code, that can be placed with the opening of database functions, or within the functions that deal with sql.

Code:
on error resume next

	

	set StrConn = Server.CreateObject("ADODB.Connection")
	StrConn.Errors.Clear ' make sure we start clean
	Err.Clear ' no errors at all for anything

	Strconn.Open strConnString
	for counter = 0 to Strconn.Errors.Count -1
		ConnErrorNumber = Err.Number
		ConnErrorDesc = StrConn.Errors(counter).Description
		If ConnErrorNumber <> 0 Then ' we have errors
			response.redirect "adminerror.asp?EC=" & ConnErrorNumber & "&ED=" & Server.URLEncode(ConnErrorDesc)
			else
				'do nothing there is no error
			end if
		end if
	next

	my_Conn.Errors.Clear ' clear past errors
	Err.Clear ' clear any other errors


now this is one code, on one page and is included in all pages that require a database. the above method can be used for a whole page too, on error resume next is used. write your function and clear errors at begining

count if there is any errors in that function and deal with.


In the error code above, i redirected to an adminerror page.
if your database isent working you need to know, this page would be a page that takes the info from the url, then sends an email to you, the site owner.

you can then show your visiter a more friendly error page, and inform them that you have been informed about the problem.

Reply With Quote
  #25  
Old January 20th, 2006, 08:29 AM
minus4's Avatar
minus4 minus4 is offline
short arse brainiac
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Leeds UK
Posts: 573 minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)  Folding Points: 800 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 22 m 36 sec
Reputation Power: 30
Send a message via MSN to minus4
another example of this, when we code we tend to try sonething

If okay Then
we display
Else
we give error
end if

however on error resume next we miss all that, unless there is a major problem. by starting with no errors. ie err = 0

then in our if we can have err = err & message

continue on

then we can great a count of all these errors on our page, and great a looping statements of all the errors found

Reply With Quote
  #26  
Old March 20th, 2006, 06:06 PM
Phoenix's Avatar
Phoenix Phoenix is offline
Web-Standards Evangelist
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Posts: 1,522 Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 48 m 4 sec
Reputation Power: 8
IRT the rest of the forum: Yes, I'm still very much alive, although I don't lurk here anymore, but if anyone wants to call on WebStandardsMan, send me a PM.

Last edited by Lafinboy : March 20th, 2006 at 07:08 PM. Reason: Removed quote from deleted spam post

Reply With Quote
  #27  
Old March 28th, 2006, 04:33 AM
Rust Indy Rust Indy is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 31 Rust Indy User rank is Private First Class (20 - 50 Reputation Level)Rust Indy User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 12 h 41 m 14 sec
Reputation Power: 3
We're on the *** end of a (roughly) 10,000 line ASP application right now, and our error-catching technique is almost exactly the one mentioned on the first page:

We set an application variable (named "bDebug" in our case) to "TRUE". In our main functions file is a function named "abug()" that takes 2 arguments - the status text to add to our debug string (page-scope variable), and a colour code to identify the type of status code it is (for example, green might be a "found item in loop" message, yellow might be an SQL statement, purple might be a success message of some kind, etc). Then anywhere we want feedback from our code we just call the function instead of using response.write. And if "bDebug" is TRUE, the debug code is displayed beneath the rest of the page.

Nine times out of ten, if a bug pops up, we can track down exactly where it is just by checking the last status message. It's a good idea to include things like function names in those status messages too - definitely makes it easier when you have a large application and any given page could generate a couple hundred status lines.

In our current application, now that we're near the end, we're adding an actual error-handling class that will log error messages and line numbers to a database (or to a file if the database fails, or an email if that fails, or it'll just give up and cry if nothing else works). All we need to do is modify our existing "abug" function to recognize an extra status code, and write those specific messages to the database.

Reply With Quote
  #28  
Old May 18th, 2006, 07:14 PM
BlueSkyRanger BlueSkyRanger is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 10 BlueSkyRanger User rank is Lance Corporal (50 - 100 Reputation Level)BlueSkyRanger User rank is Lance Corporal (50 - 100 Reputation Level)BlueSkyRanger User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 6 h 56 m 46 sec
Reputation Power: 0
For dynamic pages using >1 languages & includes

Dynamic apps with lots of includes and/or using multiple languages can be a bear to debug... especially when client-side script errors crop up in ASP pages, since the line numbers in the error messages are usually wrong.

For client-side errors, I view the browser's page source to get the rendered html, save as Test.html, then wherever there's a client-side include (external js files, etc.), remove the include reference and copy the content of the include file in it's place - moving all of the code into the one page. This way, when viewing the Test.html, client-side error message line numbers will be correct.

For database errors, I find that error messages are usually much clearer in Query Analyzer (or the database front-end of choice). I print the actual statement being passed to the database using Response.Write, copy & run in Query Analyzer for clear error messages with approximate line numbers.

For sessions and other server-side data, I keep a global debug constant. By just setting the constant to true/false, each page will execute a global function that conditionally prints all session variables, etc. at the bottom of the page.
Comments on this post
elijathegold agrees: Exactly what I do
Shadow Wizard agrees: nice.
ngaisteve1 agrees!

Reply With Quote
  #29  
Old March 14th, 2007, 12:06 PM
eglons eglons is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 28 eglons User rank is Corporal (100 - 500 Reputation Level)eglons User rank is Corporal (100 - 500 Reputation Level)eglons User rank is Corporal (100 - 500 Reputation Level)eglons User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 39 m 57 sec
Reputation Power: 0
Thumbs up

I agree with the response.write/response.end comments. I got fed up of writing the whole thing out though so went for a lazy function, seems daft, but I use it all the time now (tells you about my code huh!)

Sub print(print_string,quit)
response.write print_string & "<br>"
if quit<>0 then
response.End()
end if
End sub

Reply With Quote
  #30  
Old July 25th, 2007, 06:10 PM
jmurrayhead's Avatar
jmurrayhead jmurrayhead is offline
The Drunken Moderator
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2004
Location: Reston, VA, USA