ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ADO recordset problem with stored procedure (https://www.excelbanter.com/excel-programming/341588-ado-recordset-problem-stored-procedure.html)

[email protected]

ADO recordset problem with stored procedure
 
Object closed error!

I just figured out (again!) why I get this error while trying open/use
an ADO recordset from a stored procedure (acCmdStoredProc), while using
commandText worked just fine.

"SET NOCOUNT ON"

Apparently the "(xxxx row(s) affected)" msg output by SQL Server jacks
up the recordset object.

adding "SET NOCOUNT ON" at the top of your stored procedure will fix
this issue.


R. Choate

ADO recordset problem with stored procedure
 
Thank you for this tip. I'm sure I will end up using this information, probably sooner rather than later.

Sincerely,
--
RMC,CPA


wrote in message ups.com...
Object closed error!

I just figured out (again!) why I get this error while trying open/use
an ADO recordset from a stored procedure (acCmdStoredProc), while using
commandText worked just fine.

"SET NOCOUNT ON"

Apparently the "(xxxx row(s) affected)" msg output by SQL Server jacks
up the recordset object.

adding "SET NOCOUNT ON" at the top of your stored procedure will fix
this issue.




All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com