This is my stored procedure, and when I am calling it from my classic ASP code, I am getting the error:
Operation is not allowed when the object is c
Warnings may confuse the result. SET ANSI_WARNINGS OFF
avoids losing the SELECT result or output parameter values.
I know that this is very old. But in my case, it was the order of parameters. It worked after I set the parameters as they appear in the stored procedure. I know that there is no logical explanation to this as parameters are named and the order should not matter really.
If, for whatever reason the stored procedure does not return a result set, empty or otherwise, the recordset object will not be open, so:
if rs.state = adStateOpen then x = rs.recordcount
I am sure that this will not affect many people, but I just stumbled upon this issue. This was working in production and not in the development environment. What I found was that our stored procedure had a print statement in the development environment. I guess the print statement was mucking up the works and ADODB thought that was the record set.
This can be caused by a print statement in your stored procedure. I accidently left a few in after some performance debugging....hopefully this helps someone still working in legacy ADO.
Try this in your stored procedure:
SET NOCOUNT ON
SET ANSI_WARNINGS OFF
Right below the AS
.