![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I created a package which executes 15 other packages. Each of the inner packages contains 3 variables which determine which files to load. Is there a way to set these variables once on the main package and then have them propagated to the sub packages programmatically? The main package contains the following ActiveX script which sets the global variables. Is there a way to reference the inner package from this ActiveX script using similar code? Function Main() Dim oPKG Set oPKG = DTSGlobalVariables.Parent DTSGlobalVariables("gvHRActiveEmployees").Value = "Y" DTSGlobalVariables("gvHRTermEmployees").Value = "Y" DTSGlobalVariables("gvtblCorpStandards").Value = "N" Main = DTSTaskExecResult_Success End Function |
#3
| |||
| |||
|
|
You can reference a child package and set variables within it like this Dim lobjPackage ' Dim lobjStep Set lobjPackage = CreateObject("DTS.Package") 'load DTS Package from SQL or storage file ' lobjPackage.LoadFromStorageFile "C:\MyPath\dts_child","","","","" lobjPackage.LoadFromSQLServer "localhost", "", "", DTSSQLStgFlag_UseTrustedConnection, "", "", "", "dts_child" lobjPackage.GlobalVariables(1).Value = "localhost" lobjPackage.GlobalVariables(2).Value = DTSGlobalVariables("your global variable").Value 'execute DTS Package lobjPackage.Execute Weelin On Oct 21, 5:11 pm, rmcompute <rmcomp... (AT) discussions (DOT) microsoft.com wrote: I created a package which executes 15 other packages. Each of the inner packages contains 3 variables which determine which files to load. Is there a way to set these variables once on the main package and then have them propagated to the sub packages programmatically? The main package contains the following ActiveX script which sets the global variables. Is there a way to reference the inner package from this ActiveX script using similar code? Function Main() Dim oPKG Set oPKG = DTSGlobalVariables.Parent DTSGlobalVariables("gvHRActiveEmployees").Value = "Y" DTSGlobalVariables("gvHRTermEmployees").Value = "Y" DTSGlobalVariables("gvtblCorpStandards").Value = "N" Main = DTSTaskExecResult_Success End Function |
![]() |
| Thread Tools | |
| Display Modes | |
| |