还是用adodb.recordset吧
rstPublishers.Open "publishers", strCnn, , , adCmdTable
rstpublishers.recordcount

解决方案 »

  1.   

    select带参数的语句,不可以用Execute方法,用OpenRecordset方法
    如:
    Set DB = OpenDatabase(App.Path + "\" + DateBASEName+ ".MDB")
    Set RS = DB.OpenRecordset("SELECT * FROM TableA WHERE  IDName=" & var& " ")
    然后执行RS.MoveLast
    Rs.MoveFirst
    通过rs2.RecordCount可以获得纪录数。
      

  2.   

    dim Rst as recordset
    dim con as connection
    Rst=con.excute"select *******"
      

  3.   

    对了,在connction对象中的execute方法中有一个参数可以返回受影响的记录数