I know!.. I've seen this before...
Actual code:
'===========================================================
' Do we need to process an issue?
' Look at failed steps
for i = 1 to DTSGlobalVariables.Parent.Steps.Count
Set iStep = DTSGlobalVariables.Parent.Steps.Item(i)
if iStep.ExecutionStatus = DTSStepExecStat_Completed and _
iStep.ExecutionResult = DTSTaskExecResult_Failure then
' Get execution info
iStep.GetExecutionErrorInfo cInt(intErrorCode), _
CStr(strErrorSource), _
CStr( strErrorDescription), _
CSTr(strHelpFile), _
CLng(intHelpContext), _
CStr(strIDIfInError)
' Append it...
objSBDTSFailSteps = objSBDTSFailSteps & " DTSError Step="""
objSBDTSFailSteps = objSBDTSFailSteps & iStep.Name
objSBDTSFailSteps = objSBDTSFailSteps & """ StepDesc="""
objSBDTSFailSteps = objSBDTSFailSteps & iStep.Description
objSBDTSFailSteps = objSBDTSFailSteps & """ Code=""0x"
objSBDTSFailSteps = objSBDTSFailSteps & Hex(intErrorCode)
objSBDTSFailSteps = objSBDTSFailSteps & """ Description="""
objSBDTSFailSteps = objSBDTSFailSteps & strErrorDescription
objSBDTSFailSteps = objSBDTSFailSteps & """"
end if
Set iStep = Nothing
next
'===========================================================
etc.
Anyone got any more ideas I can try?
"Darren Green" <darren.green@reply-to-newsgroup-only.uk.com> wrote in
message news:JQSWNOByqaD$Ew8Q@sqldts.com...
[quoted text, click to view] > In article <u4zjXvwRDHA.1220@TK2MSFTNGP12.phx.gbl>, Dirc
> <dirc.khan-evans@eqos.com> writes
> >Folks
> >
> >Using SQL Server 2000 SP3
> >
> >I'm using the GetExecutionErrorInfo in ActiveX Scripting tasks to try and
> >get error information but the GetExecutionErrorInfo does not return any
data
> >except an error code of zero... consequently the elbaorate tracing and
error
> >handling system we have built around our DTS packages is a bit redundant
> >until we get meaningful error information propogated out of DTS.
> >
> >Typical example: I have a copy SQL Server object task which adds data to
a
> >table with a PK. If I try and add the same data again, I should get a
> >Primary Key constraint error... It does error but the Package
> >GetExecutionErrorInfo does not contain any SQL Error message.
> >
> >Can anybody point me in the right direction to sort this out?
> >
> >Ta
> >
> >Dirc
> >
> GetExecutionErrorInfo uses ByRef parameters to pass back the information
> such as error description etc. These are type variables, long and string
> etc. ActiveX Script only has the variant type. For ByRef to work the
> types must match exactly. Using CStr and similar only suppresses the
> error by ensuring the data passed in is type correctly, but does not
> change the variant to a true string. You will need to use a strongly
> type language. You could write a DLL in VB that could be called from
> ActiveX Script o even write a custom taks to do the entire error capture
> job. Using a custom task gives reuse too, without copy and paste of code
> between packages.
>
>
>
> --
> Darren Green (SQL Server MVP)
> DTS -
http://www.sqldts.com >
>