Re: how to retrieve [RecordsAffected] count from cmd.Excecute in V



Stephen wrote on Wed, 26 Apr 2006 14:32:29 +0100:

Glad to hear it works. I was panicking a bit yesterday when I tested your
code and got zeros, thinking that maybe my own code was no longer working
as
it was originally built with ADO 2.1. However, checking it over revealed
it
still worked (phew!), and that property setting was needed.

Interesting to hear.
It reveals that it is not an optional cosmetic setting but critical to
getting action SQL SP statement counts.

Now if only MS would update the docs <sigh>

Stephen Howe


Yeah, apparently the RecordsAffected value is only populated if you tell the
Command object that it won't be getting records back - maybe it does an
implicit SET NOCOUNT ON unless that option is set, or it's result is being
assigned to a recordset object (to get the RecordCount value set). I haven't
tried running the code with Profiler to see what is actually being passed
back and forth.

Dan


.