表A绑定在记录集Adodc1上。卡号是其中的一列
如何查询里面卡号=100801的记录个数

解决方案 »

  1.   

    select count(卡号) as 卡号数 from 表A where 卡号='100801'
      

  2.   

    怎么让卡号数赋值给text.text呢
      

  3.   

    dim rs as new adodb.recordset
    rs.open "select count(*) as 卡号数 from 表A where 卡号='100801'",conn,adopenkeyset,adlockreadonly
    if rs.recordcount>0 then
        if not isnull(rs!卡号数) then
            text1.text=rs!卡号数
        end if
    end if
    rs.close
      

  4.   

    运行时报错!!
    缺少case表达式
      

  5.   

    adodc1.recordset.filter="卡号='100801'"
    msgbox adodc1.recordset.recordcount