dbTalk Databases Forums  

Referencing Task properties in my ActiveX scripts

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


Discuss Referencing Task properties in my ActiveX scripts in the microsoft.public.sqlserver.dts forum.



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

Default Referencing Task properties in my ActiveX scripts - 09-11-2003 , 10:17 AM






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


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Referencing Task properties in my ActiveX scripts - 09-11-2003 , 10:44 AM






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

Quote:
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




Reply With Quote
  #3  
Old   
Jamie Thomson
 
Posts: n/a

Default Re: Referencing Task properties in my ActiveX scripts - 09-11-2003 , 10:55 AM



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


Quote:
-----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



.


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Referencing Task properties in my ActiveX scripts - 09-11-2003 , 01:14 PM



I am going to say that it is the Task specific properties of the given task.
There is a Tasks collection from which each task originates and shares
common properties. The CustomTask is what is specific to the task

i.e.

the DataPump task has the DestinationObjectName property
the SendMail task has the SaveMailInSentItemsFolder property.



--
--

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

Quote:
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



.




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.