469,647 Members | 1,764 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Can't trap sql errors using ADO (DTS ActiveX task)


I have the following piece of code which iterates through the potential
i =0
For Each error_item in myConn.Errors
DTSPackageLog.WriteStringToLog myConn.Errors(i).Description
DTSPackageLog.WriteStringToLog myConn.Errors(i).NativeError
i =i +1

When I execute the procedure using the SQL Query Analyzer, I obtain
several errors in the message window. However, when I execute the
procedure from the ActiveX, nothing is pushed to the log file. In fact
I have even used the following piece of code to count the number of
DTSPackageLog.WriteStringToLog "myConn.Errors.Count: " &
Returns always ZERO.
My procedure are pretty simple, I have the following:
Main procedure:
while 1 = 1
fetch my_cursor into @count

begin transaction
-- merge the parent issuer into the table issuer
exec @last_error = test_proc @count
if @last_error <> 0 goto handle_error

commit transaction

-- handle the next record

-- error(s), rollback the entire transaction
rollback transaction
test_proc procedure:
a simple insert statement, this procedure can generate errors.


Jul 23 '05 #1
0 1900

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by mystique | last post: by
1 post views Thread by Backslider | last post: by
reply views Thread by Rysiek | last post: by
2 posts views Thread by KR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.