Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 30th, 2005, 06:18 AM
Registered User
Join Date: Dec 2005
Location: Athens, , Greece.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Execute Task from ActiveX Script Task

Hello all,

I was wondering if there is a way to Execute an existing task (a Bulk Insert Task to be specific) through ActiveX task. My code is below, i get an error to the oBulkCopy. Execute line.The task already exists in the package.

Dim oPkg, oBulkTask, oBulkCopy, oEvents, oLog

Set oPkg = DTSGlobalVariables.Parent
Set oBulkTask = oPkg.Tasks.Item("DTSTask_DTSBulkInsertTask_1")

Set oBulkCopy = oBulkTask.CustomTask
oBulkCopy.DataFile = strFilePath & oTable.Name & ".txt"
MsgBox oBulkCopy.DataFile
oBulkCopy.DestinationTableName = oTable.Name
MsgBox oBulkCopy.DestinationTableName

oBulkCopy.Execute oPkg, oEvents, oLog, DTSTaskExecResult_Success
' Clear Up
Set oBulkCopy = Nothing
Set oBulkTask = Nothing
Set oPkg = Nothing

Thanks in advance and Happy New Year to everyone
Lagos Konstantinos

  #2 (permalink)  
Old January 10th, 2006, 12:37 PM
Friend of Wrox
Join Date: Dec 2005
Location: , AZ, .
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post

You could instantiate a new package and instatiate and initialize all of the objects you would need to perform the bulk copy, or you could use VBScript to dynamically alter the precedence constraints so that when your ActiveX Script Task was done the next step would be the Bulk Copy.

David Lundell
Principal Consultant and Trainer

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deployment - Execute Package task carumuga SQL Server DTS 0 October 3rd, 2008 07:43 AM
How to add task in Scheduled Task programatically amitjoshipune C# 2 July 31st, 2008 05:42 AM
Using multiple SPs in one "Execute SQL Task" yukito SQL Server DTS 2 January 3rd, 2008 12:53 AM
execute xl macro in DTS 2000 activex script task ismailc SQL Server DTS 1 December 14th, 2007 10:14 AM
ActiveX Task riga SQL Server DTS 1 October 21st, 2004 03:34 PM

All times are GMT -4. The time now is 11:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.