Using “SELECT SCOPE_IDENTITY()” in ADODB Recordset

后端 未结 4 1957
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-20 19:42

Using a VBA script in Excel, I\'m trying to insert a new row into a table and then get back the identity value of that row. If I run:



        
4条回答
  •  天涯浪人
    2020-12-20 20:22

    You are executing two statements so you will get two results back. the recordset object can only hold one result at a time - to get the other result you need to use the NextRecordset method.

    Set rs = rs.NextRecordset
    

提交回复
热议问题