Subject: Execute Package
Posted By: hortoristic Post Date: 1/12/2004 12:52:48 PM
Can anyone offer a code snippet that will allow me from a Child DTS Package, modify settings on the Parent DTS package.

Example:
DTSPack1 calls DTSPack2.  Within DTSPack2 some of the connection settings inside DTSPack1 are changed.  When DTSPack2 returns to DTSPack1 the adjusted settings would be executed.

Below is a code snipped that changes a connection setting within the parent package - but I want to execute this from a child package.  So the first line that refers to Set oPkg = DTSGlobalVariables.Parent I would think needs to be changed to refer to the parent DTS package - but I can't figure it out:

    ' Get reference to current package
    Set oPkg = DTSGlobalVariables.Parent
    ' Get Tasks collection
    Set oTask = oPkg.Tasks

    'Set up Connection
    Set oConn = oPkg.Connections("PAC")
    oConn.DataSource     = oRS.Fields("SrcDSNName")
    oConn.Password    = oRS.Fields("SrcDSNPass")
    oConn.UserID        = oRS.Fields("SrcDSNUser")


_________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice (360) 902-5928  fax (360) 902-6200

Go to topic 8451

Return to index page 971
Return to index page 970
Return to index page 969
Return to index page 968
Return to index page 967
Return to index page 966
Return to index page 965
Return to index page 964
Return to index page 963
Return to index page 962