Library tutorials & articles

Handling Errors in VB/VBA/VBS/ASP

Differences in ASP

As most ASP programmers will know, the ASP object model is a limited one compared to that of VB 6. Although this problem will be resolved with the release of ASP.NET, for now ASP programmers have to put up with a limited array of ASP error handling commands (even less than in standard VB). The essential differences are outlined here:

On Error Resume Next - Supported
On Error Goto XXX - Not Supported (as the GoTo command and labels are not supported)
Error - Not supported, use Err.Description instead.
On Error Goto 0 - Supported; cancels the On Error Resume Next statement

Therefore, ASP programmers are basically limited to using

On Error Resume Next ' possible error?
Set objObject = Server.CreateObject("MyDLL.MyClass")
If Err Then
    'an error occured
End If

I can't wait for ASP.NET!!!

Comments

  1. 26 Apr 2005 at 11:36

    Is there any way to handle errors in INFINITE LOOP.


    for example,


    While Not blnIdeaFound
                   blnIdeaFound = ProcessDetector(EXE_NAME, False)
    Wend


    IF THE CONTROL IS INSIDE THE LOOP ( INFINITE LOOP ), IS IT POSSIBLE TO HANDLE THIS CASE WITH A ERROR HANDLER ?

  2. 01 Jan 1999 at 00:00

    This thread is for discussions of Handling Errors in VB/VBA/VBS/ASP.

Leave a comment

Sign in or Join us (it's free).

Mike J

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

We'd love to hear what you think! Submit ideas or give us feedback