InputBox -- Stop execution of DTS package

  • I'm creating a DTS that prompts the user for input using an InputBox in an ActiveX Script. How can I stop execution of the DTS package if the user clicks on the Cancel button of the InputBox.

    I currently have...

    myUserResponse = InputBox ("My Prompt for the User")

    If myUserResponse = vbCancel Then

    --> Need to stop execution of DTS here <--

    End If

    What do I need to insert above to accomplish this task?

    Thanks!!!

  • Forgot to add that I'm using SQL Server 7 if that makes a difference --

    probably not in the case of VBScript.

  • If myUserResponse = "" Then

    Main = DTSTaskExecResult_Failure

    exit function

    End If

    This gets both the case where the user enters nothing and the case where they hit cancel. If you want to fail the package due to this condition, right-click the ActiveX task, chose workflow, workflow properties, options, then fail package on step failure.

    Lori

  • I think all you need is the

    Main = DTSTaskExecResult_Failure

    exit function

    where you have need to stop here at.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply