DTS : Executing a task in a package

Last Post 13 Jan 2006 08:28 AM by zsmulder. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
New Member
New Member

13 Jan 2006 08:28 AM

got a pb calling a task from another in a dts package.
i need to send emails from a db using one sendmailtask.
i am able to get the task id, update its values, but i can't make it execute.
i use the objecT.excute method, but i can't make it work, i don't know how to instantiate the parameters variables it need.
anyone know?

my lines code:

function sendMail2 (mailTo, mailCC, mailSubject, mailBody, mailFiles)
Dim oPkg, oTasks, oSendMailTask
sendMail2 = DTSTaskExecResult_Success

Set oPkg = DTSGlobalVariables.Parent
Set oTasks = oPkg.Tasks
Set oSendMailTask = oTasks("DTSTask_DTSSendMailTask_2").CustomTask
if oSendMailTask is nothing then
sendMail2 = DTSTaskExecResult_Failure
exit Function
end if
oSendMailTask.Subject = oPkg.Name

oSendMailTask.PROFILE = DTSGlobalVariables("MAIL_PROFILE").Value
oSendMailTask.PASSWORD = DTSGlobalVariables("MAIL_PASSWORD").Value
oSendMailTask.DESCRIPTION = DTSGlobalVariables("MAIL_DESCRIPTION").Value
oSendMailTask.TOLINE = mailTo
oSendMailTask.CCLINE = mailCC
oSendMailTask.FILEATTACHMENTS = mailFiles
oSendMailTask.SUBJECT = mailSubject
oSendMailTask.MESSAGETEXT = mailBody
oSendMailTask.FileAttachments = mailFiles
'oSendMailTask.Execute oPkg, null , null , 2
'Set oSendMailTask = Nothing
'Set oTasks = Nothing
'Set oPkg = Nothing
end function

You are not authorized to post a reply.

Acceptable Use Policy