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
|