dbTalk Databases Forums  

GetExecutionErrorInfo does not show errors

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss GetExecutionErrorInfo does not show errors in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dirc
 
Posts: n/a

Default GetExecutionErrorInfo does not show errors - 07-10-2003 , 12:51 PM






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





Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: GetExecutionErrorInfo does not show errors - 07-10-2003 , 01:04 PM






In article <u4zjXvwRDHA.1220 (AT) TK2MSFTNGP12 (DOT) phx.gbl>, Dirc
<dirc.khan-evans (AT) eqos (DOT) com> writes
Quote:
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




Reply With Quote
  #3  
Old   
Dirc
 
Posts: n/a

Default Re: GetExecutionErrorInfo does not show errors - 07-10-2003 , 01:15 PM



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 (AT) reply-to-newsgroup-only (DOT) uk.com> wrote in
message news:JQSWNOByqaD$Ew8Q (AT) sqldts (DOT) com...
Quote:
In article <u4zjXvwRDHA.1220 (AT) TK2MSFTNGP12 (DOT) phx.gbl>, Dirc
dirc.khan-evans (AT) eqos (DOT) 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





Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: GetExecutionErrorInfo does not show errors - 07-10-2003 , 02:57 PM



In article <#GWEE9wRDHA.2008 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Dirc
<dirc.khan-evans (AT) eqos (DOT) com> writes
Quote:
I know!.. I've seen this before...
snip

If you know it won't work why are you still trying?

I tried to explain why it will not work, and your only alternative is to
use a strongly type language to call the method-

Quote:
You could write a DLL in VB that could be called from
ActiveX Script o even write a custom task 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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.