Non fatal SP error causes ADO recordset to be nulled?

  • Thread starter Thread starter TJ Stirn
  • Start date Start date
T

TJ Stirn

Greetings,

Here is the problem:

We have a stored procedure that selects a set of
candidate rows. It then attempts to lock the candidate
rows via inserts into a lock table. If a row is already
locked we handle the pk insert error within the stored
procedure and remove the candidate from the result set.
The stored procedure side works great. However, in the
C++ client the command.execute method which is wrapped in
a try block catches the exception normally but there is
no result set returned!

For the life of me I can't figure out why ADO would
eliminate the result set when the execute returns an
error, it is nulling out the pointer even though the
select in the stored procedure returned results.

Anyone seen this before?
 
Hi TJ,

I presume that assignament is not actually assigned as execution flow is
diverted into catch block.
You could, rather then rising exceptions, return an output parameter to
signal the error.
 
Back
Top