Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 chaning FTP task properties

Author  Topic 

hgorijal
Constraint Violating Yak Guru

277 Posts

Posted - 2004-11-24 : 05:54:19
Can any one help me with a small ActiveX script to change the following properties of an FTP task in DTS.

The SourceSite, SourceFilename and DestSite properties need to be dinamically changed to DTS global variables.

TIA

something like this..... (am not sure which object to capture in the below code (bold))

Option Explicit
Function Main()
' Declare Variables
Dim pkg
Dim FTPtask

set pkg = DTSGlobalVariables.Parent

set FTPtask= pkg.Steps("DTSStep_DTSFTPTask_1")

'Source is a network directory.
FTPTask.SourceLocation = 1

FTPTask.SourceSite = DTSGlobalVariables("Source_dir").Value FTPTask.SourceFilename = DTSGlobalVariables("Source_file_details").Value
FTPTask.DestSite = DTSGlobalVariables("Dest_dir").Value


Main = DTSTaskExecResult_Success
End Function


Hemanth Gorijala
Exchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each.

nreinholdt
Starting Member

8 Posts

Posted - 2004-11-27 : 22:32:21
Hi Hemanth:

I believe you would want choose a task instead of a step, with code that might look like this:

Set FTPtask = pkg.Tasks("DTSTask_DTSFTPTask_2").CustomTask

Note the prefix for tasks is DTSTask and not DTSStep. I also find it interesting that it is necessary to use "CustomTask" even for ordinary built-in tasks.

Darren Green's articles have been very helpful for me in this area. The "How to dynamically change... Tasks" link at
http://www.databasejournal.com/features/mssql/article.php/1462291
may be helpful to you too.

I hope that's helpful for you!

Niels



nragamuffin
Go to Top of Page
   

- Advertisement -