Vbscript.. On error Goto

Posted on 2007-08-08
Medium Priority
Last Modified: 2010-05-28
Hi. Good Day to all. I have this problem. How can i do this in vbscript? I know this works in vb 6.

On Error Goto ErrHandler
 statement1 ' this is the line having an error

  statements if error has occured

Question by:amcurso
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 600 total points
ID: 19657211
in vbscript, you only have the on error resume next.
and after each critical statement, check err.number
LVL 58

Accepted Solution

amit_g earned 900 total points
ID: 19657219
VBScript doesn't have this kind of error handler mechanism. It has only

On Error Resume Next
On Error GoTo 0

i.e. to tolerate the error. You need to then test error after every possible statement using

If Err.Number <> 0 then


Author Comment

ID: 19657320
Thanks. i just realized that. sigh... :-(

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question