VB6 ADODB.Recordset RecordCount property always returns -1

前端 未结 12 1803
别跟我提以往
别跟我提以往 2020-12-11 15:43

I am trying to get some old VB6 code to work with SQL Server Compact.

I can connect, open the database and all seems well. I can run insert select commands which

12条回答
  •  一向
    一向 (楼主)
    2020-12-11 16:41

    Replace Set rs = mCmd.Execute with:

    set rs = new ADODB.Recordset
    rs.Open "select * from myTestTable", mDBConnection, adOpenDynamic, adLockOptimistic
    

    The adOpenDynamic will allow a forward/backward read through to get your recordcount.

提交回复
热议问题