WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE COM ADO CDO ADSI LDAP
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

WinBatch OnError

 Keywords:  VB VBA VBScript On Error OnError mechanism

Question:

I need some help understanding something. I'm using an OLE library (csmail from codestone) that handles errors in a rather opaque way, from a WBT programmers view.

In the documentation, all methods say this about return values: There is no return value from this method. If any error occurs while saving the message an error will be raised and should be handled through the VB/VBA/VBScript On Error mechanism.

When an error occurs, all I get using standard LastError()is "1261 OLE Exception".

Apparently, there is some other mechanism used by VB/VBA/VBScript that is reporting the real errors (they give a healthy list of possible error return values). How can I see the error numbers that *would* be reported through the VBA On Error mechanism?

Answer:

'IntControl 73' is the WinBatch equivalent to the VBS 'OnError' mechanism and the IntControl often places the COM error information you are looking for in the wberroradditionalinfo (wberrorarray[6]) variable.

However, WinBatch is a little picky about COM exceptions. It expects the exception information to be formated according to specification and otherwise will not use it. WinBatch is setup this way because it was found that COM exceptions missing complete information often turned out to be garbage and do more harm that good.

In your case, it it likely that that the object is not generating all the error information expected so WinBatch is not willing to use the error text.

There has been some discussion about revising this policy to make WinBatch a little more accepting of poorly formed COM exception error information. Look for this change in some future release.


Article ID:   W18029
Filename:   WinBatch OnError.txt
File Created: 2009:02:26:09:55:10
Last Updated: 2009:02:26:09:55:10