dbTalk Databases Forums  

Changing sub-package global variable with ActiveX

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Changing sub-package global variable with ActiveX in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rmcompute
 
Posts: n/a

Default Changing sub-package global variable with ActiveX - 07-06-2006 , 06:03 PM






I set up a package within another package. The inner package has a global
variable, vartest, of which its default value can be manually changed from
the outer package by clicking on the package task and then clicking Inner
Package Global Variables. I set up an ActiveX script to try to
programatically change the inner package global variable, but seem to be
having trouble:

Set oPKG = DTSGlobalVariables.Parent
oPKG.Steps("DTSStep_DTSExecutePackageTask_1").
DTSGlobalVariables("Vartest").Value = "Phone"

Object doesn’t support this property or method ……………..


Can this be done ? Also can the step name be changed,
DTSStep_DTSExecutePackageTask_1 is not very descriptive.


Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Changing sub-package global variable with ActiveX - 07-07-2006 , 01:19 AM







rmcompute wrote:
Quote:
I set up a package within another package. The inner package has a global
variable, vartest, of which its default value can be manually changed from
the outer package by clicking on the package task and then clicking Inner
Package Global Variables. I set up an ActiveX script to try to
programatically change the inner package global variable, but seem to be
having trouble:

Set oPKG = DTSGlobalVariables.Parent
oPKG.Steps("DTSStep_DTSExecutePackageTask_1").
DTSGlobalVariables("Vartest").Value = "Phone"

Object doesn't support this property or method .................


Can this be done ? Also can the step name be changed,
DTSStep_DTSExecutePackageTask_1 is not very descriptive.
Hi rmcompute,
the 'Step' object does not have a collection of Global Variables, so
your script is wrong.
You should set the value of a Global Variable in the outer package
using the ActiveX script, then pass this GlobalVar to the inner one.

If you wanna change a step name:

1) Delete temporarly the costraints which link this step to other
steps.
2) Mouse Righ-Click-->Disconnected edit --> Steps --> (your step) -->
Name porperty
3) After having renamed the step restore the constraints you previously
deleted.

Bye



Reply With Quote
  #3  
Old   
rmcompute
 
Posts: n/a

Default Re: Changing sub-package global variable with ActiveX - 07-08-2006 , 11:43 AM



Thanks Davide. The disconnected edit worked. I still have an issue with
passing the global variable to the inner package. I created a variable in
the outer package with:

DTSGlobalVariables("Vartest").value = "Test05"

Inside of the Package task I set the following on the
InnerPackageGlobalVariables:

Name Type Value
Vartest String <not displayable>

The global variable has definitely been set on the outer package, but it is
not being passed to the inner package. Is there something else that needs to
be done ?


"Davide" wrote:

Quote:
rmcompute wrote:
I set up a package within another package. The inner package has a global
variable, vartest, of which its default value can be manually changed from
the outer package by clicking on the package task and then clicking Inner
Package Global Variables. I set up an ActiveX script to try to
programatically change the inner package global variable, but seem to be
having trouble:

Set oPKG = DTSGlobalVariables.Parent
oPKG.Steps("DTSStep_DTSExecutePackageTask_1").
DTSGlobalVariables("Vartest").Value = "Phone"

Object doesn't support this property or method .................


Can this be done ? Also can the step name be changed,
DTSStep_DTSExecutePackageTask_1 is not very descriptive.

Hi rmcompute,
the 'Step' object does not have a collection of Global Variables, so
your script is wrong.
You should set the value of a Global Variable in the outer package
using the ActiveX script, then pass this GlobalVar to the inner one.

If you wanna change a step name:

1) Delete temporarly the costraints which link this step to other
steps.
2) Mouse Righ-Click-->Disconnected edit --> Steps --> (your step) --
Name porperty
3) After having renamed the step restore the constraints you previously
deleted.

Bye



Reply With Quote
  #4  
Old   
Davide
 
Posts: n/a

Default Re: Changing sub-package global variable with ActiveX - 07-09-2006 , 08:18 AM




rmcompute wrote:
Quote:
Thanks Davide. The disconnected edit worked. I still have an issue with
passing the global variable to the inner package. I created a variable in
the outer package with:

DTSGlobalVariables("Vartest").value = "Test05"

Inside of the Package task I set the following on the
InnerPackageGlobalVariables:

Name Type Value
Vartest String <not displayable

The global variable has definitely been set on the outer package, but it is
not being passed to the inner package. Is there something else that needs to
be done ?


"Davide" wrote:


rmcompute wrote:
I set up a package within another package. The inner package has a global
variable, vartest, of which its default value can be manually changed from
the outer package by clicking on the package task and then clicking Inner
Package Global Variables. I set up an ActiveX script to try to
programatically change the inner package global variable, but seem to be
having trouble:

Set oPKG = DTSGlobalVariables.Parent
oPKG.Steps("DTSStep_DTSExecutePackageTask_1").
DTSGlobalVariables("Vartest").Value = "Phone"

Object doesn't support this property or method .................


Can this be done ? Also can the step name be changed,
DTSStep_DTSExecutePackageTask_1 is not very descriptive.

Hi rmcompute,
the 'Step' object does not have a collection of Global Variables, so
your script is wrong.
You should set the value of a Global Variable in the outer package
using the ActiveX script, then pass this GlobalVar to the inner one.

If you wanna change a step name:

1) Delete temporarly the costraints which link this step to other
steps.
2) Mouse Righ-Click-->Disconnected edit --> Steps --> (your step) --
Name porperty
3) After having renamed the step restore the constraints you previously
deleted.

Bye


To pass the Variable to inner package:

Inside of the Package task select 'VarTest' from the
OuterPackageGlobalVariables.
Bye



Reply With Quote
  #5  
Old   
rmcompute
 
Posts: n/a

Default Re: Changing sub-package global variable with ActiveX - 07-09-2006 , 06:20 PM



It worked. Thanks again !

"Davide" wrote:

Quote:
rmcompute wrote:
Thanks Davide. The disconnected edit worked. I still have an issue with
passing the global variable to the inner package. I created a variable in
the outer package with:

DTSGlobalVariables("Vartest").value = "Test05"

Inside of the Package task I set the following on the
InnerPackageGlobalVariables:

Name Type Value
Vartest String <not displayable

The global variable has definitely been set on the outer package, but it is
not being passed to the inner package. Is there something else that needs to
be done ?


"Davide" wrote:


rmcompute wrote:
I set up a package within another package. The inner package has a global
variable, vartest, of which its default value can be manually changed from
the outer package by clicking on the package task and then clicking Inner
Package Global Variables. I set up an ActiveX script to try to
programatically change the inner package global variable, but seem to be
having trouble:

Set oPKG = DTSGlobalVariables.Parent
oPKG.Steps("DTSStep_DTSExecutePackageTask_1").
DTSGlobalVariables("Vartest").Value = "Phone"

Object doesn't support this property or method .................


Can this be done ? Also can the step name be changed,
DTSStep_DTSExecutePackageTask_1 is not very descriptive.

Hi rmcompute,
the 'Step' object does not have a collection of Global Variables, so
your script is wrong.
You should set the value of a Global Variable in the outer package
using the ActiveX script, then pass this GlobalVar to the inner one.

If you wanna change a step name:

1) Delete temporarly the costraints which link this step to other
steps.
2) Mouse Righ-Click-->Disconnected edit --> Steps --> (your step) --
Name porperty
3) After having renamed the step restore the constraints you previously
deleted.

Bye



To pass the Variable to inner package:

Inside of the Package task select 'VarTest' from the
OuterPackageGlobalVariables.
Bye



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.