Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2007, 02:30 AM
Authorized User
 
Join Date: Aug 2006
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default error handling in ASP

hi there..i need some help or guidance here. how can i write a code that can catch the error before insert the valueinto database and then display the error msg in a nice view but not like the normal error display on IE that will display which error code line and file line one? plz help in ASP..thanx alot

 
Old November 14th, 2007, 09:53 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hello,
     Why don't you head over to the Wrox ASP 3 wiki as it has the entire contents of the book: Beginning Active Server Pages 3.0 and chapter 9 is completely dedicated to handling errors!

http://asp3wiki.wrox.com/wiki/show/9...Error+Handling

Should you need any further help please post back here.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 14th, 2007, 12:47 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is a little "dance" that you must do when you add error handling code to your ASP scripts (at least, if you are using VBScript)
The asp3wiki that Doug mentioned goes into it a little bit at this page:
http://asp3wiki.wrox.com/wiki/show/9...stError+Method

In vbscript you use "on error resume next" at the "top" of your code block.(hopefully you have your code in a sub or function [a method]). The "on error resume next" will to allow the script to continue running after an error. Then you check for any errors throughout your method or other block of code, using the ASPError object, which is an object made available via the Server object.

I strongly recommend that you place all code into classes - this allows you to isolate (that is... encapsulate) logic, and is about the only reaosnable way to "scope" variables and method names in vbscript. And of course, use error handling code where appropriate.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems





Similar Threads
Thread Thread Starter Forum Replies Last Post
error handling prv299 .NET Web Services 5 May 19th, 2008 07:27 AM
Error Handling in asp.net 2.0 kulkarnimonica ASP.NET 2.0 Professional 1 June 29th, 2007 03:33 AM
error handling Abhinav_jain_mca General .NET 5 December 21st, 2005 01:12 AM
Error Handling in ASP.NET myunus VS.NET 2002/2003 1 August 18th, 2004 06:18 PM
error handling in asp.net e-commerce programming 123 All Other Wrox Books 0 October 19th, 2003 04:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.