Trouble calling AddObjectForTransfer method via Tasks Collection -
10-18-2005
, 10:51 AM
Hi,
I have a package (created using Enterprise manager IDE) with a
DTSTransferObjectsTask. What I would like to do is to be able to modify the
list of tables to be copied by this task using an ActiveX Script Task.
I am able to browse the tasks collection. The problem is that the collection
contains a "Task" object, and when I call a method belonging to a
"DTSTransferObjectsTask"
(a sub-type) I always get an error stating that this object does not support
this method. Is there a way to do it or am I losing my time ?
Here the ActiveX script code that I am using :
=================================
Function Main()
Dim pkg
Dim Tsk
Set pkg = DTSGlobalVariables.Parent
Set tsk=pkg.tasks("DTSTask_DTSTransferObjectsTask_1")
MsgBox ("pkg:" & tsk.description)
MsgBox (TypeName(Tsk))
pkg.tasks("DTSTask_DTSTransferObjectsTask_1").AddO bjectForTransfer
"PGR_Modes", "dbo", 8
Main = DTSTaskExecResult_Failure
End Function
=========================
Error arise on line 11.
Thanks in advance. |