Execute PAckage Task

  • Hi...

    how can i get the error on a "Execute PAckage Task"?

    i call a package that fails but in my main package in a acitvex script seems to be success

     

    '**********************************************************************

    '  Visual Basic ActiveX Script

    '************************************************************************

    Function Main()

     dim i

     dim oPackage

     

     Set oPackage = DTSGlobalVariables.Parent

     

     

      For i = 1 To oPackage.Steps.Count

      if oPackage.Steps(i).description = "xxxMyPkgxx" then

             If oPackage.Steps(i).ExecutionResult = DTSStepExecResult_Failure    Then

                   MSGBOX("ERROR")

            End If

     End If

     Next

     Main = DTSTaskExecResult_Success

    End Function

    ************************************************************************

    i don't see the message but the pkg fails...

    why??

    thanks!

    MC

     

     

     

     

     

  • Is this an old package ? Every package has version control. When you execute the package and do not clear the version, it will execute the older version.

  • Try this to blank out  property ID of ExecutePakcageTask so when you will run the latest version.

    Funcation Main()

    dim objPackage

    dim objTask

    dim objPropertyID

    set objPackage = DTSGlobalVariables.Parent

    For each objTask in objPackage.Tasks

    IF LEFT(objTask.Name, 30) = "DTSTask_DTSExecutePackageTask_'  THEN

    set taskprops = objTask.Properties

    set objPropertyID = taskprops("PackageID")

    blnID = objPropertyID.Set

    if blnID = True then

    objPropertyID.value = ""    ----- set to blank

    End if

    End IF

     

     

  • the package has no old version 🙁

    in the callde package i produce an error (with a fake table name)

    in the execution window i can see the error ("table name does not exists")... but in my active x, when i try to catch the error the task sems "succed"...

    please help!!!

    😀

     

     

     

  • try this.

    Function Main()

    dim pkg, stp

    Main = DTSTaskExecResult_Success

    set pkg = DTSGlobalVariables.Parent

    For each stp in pkg.Steps

           If stp.ExecutionResult = DTSStepExecResult_Failure

              THEN

              Msgbox ("Error")

              Main = DTSTaskExecResult_Failure

              End If

              Exit For

    Next

    End Function

     

     

  • If you want to know which step

    You can put down

    Msgbox(stp.Description)

     

Viewing 6 posts - 1 through 6 (of 6 total)

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