ADODB connection ..... Rows Affected count?
Been playing around with this today and am struggling to get back the info I want.
I'm using C# Script (so JScript rules probably apply).
Up to now, I've been using a connection object, and a recordset object and running SQL with is all stuff that returns recordsets. All fine. No problems.
I now want to add a function which will execute non-recordset returning SQL.
This is using the "Execute" method of the connection object.
It runs fine. The SQL is executed and the DB (it's doing an update) is altered correctly. I can manually check all that in SQL Management Studio.
However, I can't find any way to get the number of rows affected by the Execute method? It can supposedly be applied as a parameter within the Execute which should be populated when the Execute runs. But it doesn't.
We're starting to think this is a limitation of the ADODB connection and C# Script/Jscript inability to accept passed in non-object by ref?
Any ideas?
I catch it if the connection fails.
I catch it is the SQL is invalid and generates an error.
But I want to report out if valid sequel is run and some/none rows are affected.
Any ideas?
(I'm considering shipping the execute out to a script extension which I can write in VB Script which doesn't have the same by ref limitations but this seems like a long way for a short cut ....)