trap errors in event sink

trap errors in event sink

Post by Bill » Sat, 13 Dec 2003 01:19:59

can anyone pls tell me how to catch an error in a vbscript
code that runs when an smtp onArrival event is triggered.
I am using Exchange 2000. I can send another email within
the script with CreateObject("CDONTS.NewMail"), but when I
try and input data into my Access database nothing
happens. it could be a security thing but as i can't see
any error message i'm stuck.

can you use something like If Err.Number > 0 then... in
VBscript for sink events?



trap errors in event sink

Post by Siegfried » Mon, 15 Dec 2003 09:33:30

Sure you can. First you need to add an "On Error Resume Next" on top of your
code. Then you need to clean out the error buffer each time before you check
for an error like this:

If Err.Number <> 0 Then


Siegfried Weber