January 14, 2003 at 9:58 am
Hi All,
I'm basically looking for advice on this one. I inherited (isn't that always the case) a DTS that runs a VB.exe that sends mail when a task is completed, however there is nothing to fail the VB if the VB encounters an error. The DTS still keeps running. The task at hand is to fail the VB.exe from within the DTS. I've done some research and came up with this following code:
Public Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
From within a sub in VB, I declare an var call someting like
Dim Failrate AS Long
When an error is encountered I call the process something like the following:
Failrate = 1
Call ExitProcess(FailRate)
Has anyone done anything similar to this? Normally I would just run the VB exe from a schedule job from within the task scheduler. Very little documentation left on this.
Thanks
JMC
JMC
January 14, 2003 at 10:37 am
Try just raising an Error. When you raise an error the HRESULT of the com call will be set to a non successful error code. The ExitProcess api can be dangerous as it will not provide your objects time to clean up after themselves properly.
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B288216
I was thinking dll, and you said exe, but it still applies.
Tim C.
//Will write code for food
One Windows to rule them all, One Windows to find them,
One Windows to bring them all and in the darkness bind them
In the Land of Microsoft where the Shadows lie.
Edited by - tcartwright on 01/14/2003 10:39:00 AM
Tim C //Will code for food
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply