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!!!

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++: an octopus made by nailing extra legs onto a dog.” - Steve Taylor