dbTalk Databases Forums  

Trouble calling AddObjectForTransfer method via Tasks Collection

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


Discuss Trouble calling AddObjectForTransfer method via Tasks Collection in the microsoft.public.sqlserver.dts forum.



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

Default 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.

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.