Execute Task from ActiveX Script Task
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"
oBulkCopy.DestinationTableName = oTable.Name
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