It.ProfessionalSQL.com> writes
Quote:>I'm building a custom FTP task to do a PUT in SQL Server 7.0 (the example
>code I've seen out there is truly just simple examples and is always focused
>around a GET). I can detect in the task a wide variety of errors, but the
>only option I seem to have in terms of passing something back to the calling
>package is a DTSTaskExecResult_Failure - this makes it hard for me to judge
>what went wrong. I'd like to pass out something of an errors collection - at
>least a collection of messages or a single message that is more
>representative of the error than "task reported failure".
>Is there a specific method call or property set I can refer to in order to
>deal with custom error messages in a custom DTS task? I don't see anything
>in the object model.
>Thanks,
>Rob
You can use the pPackageEvents Object to raise OnError-
pPackageEvents.OnError m_sName & " (" & m_sDescription & ")
CustomTask_Execute", lErr, sErrSrc, sErrDesc, "", 0, "", True
I found some strange behaviour when using pTaskResult =
DTSTaskExecResult_Failure, but can't remember what now. Just looking at
one of my half finished tasks where I really started looking at raising
errors in a nice way to give as much info as possible, I've actually got
it commented out.
I seem to recall if I didn't it suppressed my message. The workflow in
the rest of the package worked as excepted though.
You could also just use Err.Raise with or without
DTSTaskExecResult_Failure. I couldn't decide which worked best,
Err.Raise or OnError, or at least can't remember if I did!
Regards
--
Darren Green
SQL/DTS - http://www.swynk.com/friends/green/