Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2002
    Location
    NYC
    Posts
    8

    Unanswered: Passing Global Variables from a Execute Package Task

    I have a package (Package1) that is run from another package (Package2) via a Execute Package Task. I set a Global Variable called sErrorMessage in the in Package1 and would like to access that Global Variable in an ActiveX Script Task in Package2. How can I do this?

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Package 1:
    Edit your Execute Package Task, and click on the "Outer Package Global Variables" tab. Select all the Global Variables you want available to Package 2. Save and close.

    Package 2:
    Edit your ActiveX Script Task and use the code below to access the variable:
    DTSGlobalVariables("<global variable name>").Value
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Dec 2002
    Location
    NYC
    Posts
    8
    Package1 doesnt have an Execute Package Task, Package2 does....
    Code:
    Package1:
    ActiveX Script ---> Connection1 -TransformData-> Connection2
    
    Package2:
    Exec Package1 -Success-> Send Success Email
                  '-Failure-> ActiveX (msgbox DTSGlobalVariables("sErrorMessage").Value) ---> Send Failure Email
    Last edited by d_weasel; 04-28-04 at 20:01.

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Ooookay.. so substitute 2 for 1 and 1 for 2... done...
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    Dec 2002
    Location
    NYC
    Posts
    8
    Thats what I figured when you posted, but I tried that and got nothing......I might have edited the reply since you looked at it....

    When I run Package1 by itself I can see in the Package1 Properties that the Global Variable is being set properly from Package1.

    The Execute Package Task in Package2 has the Outer Package Global Variable selected, but when I reference it with DTSGlobalVariables("sErrorMessage").Value in ActiveX Code it shows the variable as being empty.

  6. #6
    Join Date
    Dec 2002
    Location
    NYC
    Posts
    8
    Just a update on this:

    Seppuku was nice enough the help me via AIM. So far we have come to the conclusion that there is no builtin way for a child to pass data to the parent except maybe through file drops, or writing to a db table.

  7. #7
    Join Date
    Dec 2002
    Location
    NYC
    Posts
    8
    Will attempt having the child write to a common table for communication...and will post the results here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •