classic asp on error resume next
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 classic asp on error resume next example Business Learn more about hiring developers or posting ads with us Stack Overflow Questions classic asp on error resume next scope Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million
Asp Classic On Error Goto 0programmers, just like you, helping each other. Join them; it only takes a minute: Sign up using “on error resume next” in classic ASP, and how to handle errors up vote 6 down vote favorite Good day
Classic Asp Try Catchall, I would like to ask a thing about on error resume next let's assume we have a loop to navigate through a recordset like: Do while not rs.EOF query = "UPDATE ...." conn.execute(query) rs.movenext loop i would like to be sure the UPDATE is going good, and i would like to check if there is some problems, so I have put a debugging features in the code like: Do while not rs.EOF query classic asp error handling = "UPDATE ...." on error resume next conn.execute(query) If Err.Number <> 0 Then Response.write(Err.Number) response.write("
") response.write(Err.description) response.write("
") response.write(query) response.write("
") end if on error goto 0 rs.movenext loop the question is : during a loop, if it encounters an error, the next cycle will the error be there (and so triggers again the error block) ? or on error goto 0 will clear the Err object? in other words, will it works as a error handling? asp-classic vbscript error-handling share|improve this question edited Jul 3 '13 at 10:51 Alex K. 106k16146194 asked Jul 3 '13 at 10:43 Matteo Bononi 'peorthyr' 76951749 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote accepted VBScript resets the error on goto 0: on error resume next i = 1 / 0 WScript.echo( err.number ) '' prints 11 (div by 0) on error goto 0 WScript.echo( err.number ) '' prints 0 (no error) There is also the explicit err.clear(). share|improve this answer answered Jul 3 '13 at 10:49 Alex K. 106k16146194 oh, nice to know the err.clear(), thanks ! :D –Matteo Bononi 'peorthyr' Jul 3 '13 at 10:53 add a comment| up vote 2 down vote The correct code to use is Err.Clear I have tested it with the following code <%on error resume next response.write (p(10)) Response.write(Err.N
360 games PC games
Portability Issues C++ & MFC » General Array Handling Binary Trees Bits and Bytes Buffer & Memory Manipulation Callbacks Classes and Class Use http://www.codeguru.com/csharp/.net/net_general/debugginganderrorhandling/article.php/c19557/ASP-and-the-Error-Handler.htm Collections Compression Drag and Drop Events Exceptions External Links File I/O Function Calling Linked Lists Memory Tracking Object Oriented Programming (OOP) Open FAQ Parsing Patterns Pointers Portability http://www.codeproject.com/Questions/404785/Error-handling-in-Classic-ASP RTTI Serialization Singletons Standard Template Library (STL) Templates Tutorials Date & Time » General Date Controls Time Routines C++/CLI » .NET Framework Classes General ASP/ASP.NET Boxing on error and UnBoxing Components Garbage Collection and Finalizers Interop Moving from Unmanaged Processes & Threads Templates Visual Studio .NET 2003 String Programming » General CString Alternatives CString Extensions CString Manipulation Open FAQ Regular Expressions String Arrays String Conversions .NET COM-based Technologies » ATL & WTL Programming » General ATL Active Scripting ActiveX Controls Database Debugging asp on error External links Graphics Support Misc. Performance Printing Tutorials Utilities Windows Template Library (WTL) ActiveX Programming » General Active Scripting ActiveX Controls ActiveX Documents Apartments & Threading Error Handling External links General COM/DCOM Misc. Registry Security Structured Storage Tutorials Wrappers COM+ » General COM Interop Managed Code / .NET SOAP and Web Services Shell Programming » General Open FAQ Shortcuts Tray Icons Previous Section Manager Controls » Property Sheet » Open FAQ Property Sheet Buttons Sizing Wizards Button Control » Advanced Buttons Bitmap Buttons Flat Buttons Menus Non-Rectangular buttons Windows XP ComboBox » Colour Pickers DropDown Font selection combos Multicolumn combos Special Effects Tooltips Edit Control » Background & Color Editors Keyboard Masked Edit Controls Passwords and Security Spin Controls Transparent ImageList Control » Open FAQ ListBox Control » Checkboxes Color Listboxes Drag & Drop LEDs ListView Control » Advanced Background color and image Checkboxes Columns Custom Drawing Data Deleting Drag & Drop Editing items and subitem FilterBar Grid lines