![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I need to change, at runtime, a property (namely [DestinationObjectName]) for one of my data pump task objects. It won't let me do it though - I can't reference the property that I want to. Allow me to demonstrate: The following bit of simple code works fine: ================================================== ======== Function Main() Dim pkg Set pkg = DTSGlobalVariables.Parent Dim swapDB Set swapDB = pkg.GlobalVariables ("SWAP_DATABASE") For Each tsk in pkg.Tasks msgbox tsk.Name Next Main = DTSTaskExecResult_Success End Function ================================================== ======== but this doesn't (note the subtle different - I'm referencing a different task property): ================================================== ======== Function Main() Dim pkg Set pkg = DTSGlobalVariables.Parent Dim swapDB Set swapDB = pkg.GlobalVariables ("SWAP_DATABASE") For Each tsk in pkg.Tasks msgbox tsk.DestinationObjectName Next Main = DTSTaskExecResult_Success End Function ================================================== ======== It fails with the following error: Object doesn't support this property or method: 'tsk.DestinationObjectName' Why can't I reference this property and how can I get round this problem? I NEED to be able to dynamically change this property at runtime. Thanks in advance for any advice. Regards Jamie |
#3
| |||
| |||
|
|
-----Original Message----- DestinationObjectName is part of the CustomTask for a Task dim pkg dim tsk set pkg = DTSGlobalVariables.Parent set tsk = pkg.Tasks("Name of task").Customtask ' will be a datapump msgbox tsk.DestinationObjectName -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Jamie Thomson" <jamiet (AT) int21 (DOT) com> wrote in message news:06c801c37877$dd152e20$a001280a (AT) phx (DOT) gbl... Hello, I need to change, at runtime, a property (namely [DestinationObjectName]) for one of my data pump task objects. It won't let me do it though - I can't reference the property that I want to. Allow me to demonstrate: The following bit of simple code works fine: ================================================== ======== Function Main() Dim pkg Set pkg = DTSGlobalVariables.Parent Dim swapDB Set swapDB = pkg.GlobalVariables ("SWAP_DATABASE") For Each tsk in pkg.Tasks msgbox tsk.Name Next Main = DTSTaskExecResult_Success End Function ================================================== ======== but this doesn't (note the subtle different - I'm referencing a different task property): ================================================== ======== Function Main() Dim pkg Set pkg = DTSGlobalVariables.Parent Dim swapDB Set swapDB = pkg.GlobalVariables ("SWAP_DATABASE") For Each tsk in pkg.Tasks msgbox tsk.DestinationObjectName Next Main = DTSTaskExecResult_Success End Function ================================================== ======== It fails with the following error: Object doesn't support this property or method: 'tsk.DestinationObjectName' Why can't I reference this property and how can I get round this problem? I NEED to be able to dynamically change this property at runtime. Thanks in advance for any advice. Regards Jamie . |
#4
| |||
| |||
|
|
Thanks Allan, thats great. I don't suppose someone could give me a quick synopsis of the difference between a task and a custom task and why my data pump tasks each contain a custom task. If you go by what Disconnected Edit seems to suggest, DestinationObjectName is a property of my task Regards Jamie -----Original Message----- DestinationObjectName is part of the CustomTask for a Task dim pkg dim tsk set pkg = DTSGlobalVariables.Parent set tsk = pkg.Tasks("Name of task").Customtask ' will be a datapump msgbox tsk.DestinationObjectName -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Jamie Thomson" <jamiet (AT) int21 (DOT) com> wrote in message news:06c801c37877$dd152e20$a001280a (AT) phx (DOT) gbl... Hello, I need to change, at runtime, a property (namely [DestinationObjectName]) for one of my data pump task objects. It won't let me do it though - I can't reference the property that I want to. Allow me to demonstrate: The following bit of simple code works fine: ================================================== ======== Function Main() Dim pkg Set pkg = DTSGlobalVariables.Parent Dim swapDB Set swapDB = pkg.GlobalVariables ("SWAP_DATABASE") For Each tsk in pkg.Tasks msgbox tsk.Name Next Main = DTSTaskExecResult_Success End Function ================================================== ======== but this doesn't (note the subtle different - I'm referencing a different task property): ================================================== ======== Function Main() Dim pkg Set pkg = DTSGlobalVariables.Parent Dim swapDB Set swapDB = pkg.GlobalVariables ("SWAP_DATABASE") For Each tsk in pkg.Tasks msgbox tsk.DestinationObjectName Next Main = DTSTaskExecResult_Success End Function ================================================== ======== It fails with the following error: Object doesn't support this property or method: 'tsk.DestinationObjectName' Why can't I reference this property and how can I get round this problem? I NEED to be able to dynamically change this property at runtime. Thanks in advance for any advice. Regards Jamie . |
![]() |
| Thread Tools | |
| Display Modes | |
| |