“Operation is not allowed when the object is closed” when executing stored procedure

后端 未结 7 717
猫巷女王i
猫巷女王i 2020-12-20 11:12

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

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 11:31

    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
    

提交回复
热议问题