I have a VBA that runs a command text to update a table. The table has a trigger on UPDATE.
When I do:
Set rs = cmd1.Execute(affectedCount)
the affectedCount returns affected rows from trigger (I think).
How do I make it return the original update statement’s affected row count?
Assuming you’re using SQL Server, I had a similar problem a while ago. I’m not sure if it’s related but ADODB would get “confused” by the “# records affected” messages that were generated by SQL Server.
We solved this by adding
To the top of affected triggers / procedures to suppress the message. You can then try running your statement from SQL Management Studio to see exactly which “# records affected” messages are being generated.
Don’t know if this will help but maybe worth a try.