set rs=conn.execute("SELECT * FROM product where bigclass='"+BigClassName+"' and (smallclass='"+SmallClassName+"') ORDER BY id DESC")
if not rs.eof then
pronum=rs.recordcount
end if
...全文
276打赏收藏
统计数据库中的记录怎么出问题?
我用下面的代码来统计数据库中满足条件的记录,可是怎么老是得到的值为-1呢? set rs=conn.execute("SELECT * FROM product where bigclass='"+BigClassName+"' and (smallclass='"+SmallClassName+"') ORDER BY id DESC") if not rs.eof then pronum=rs.recordcount end if
conn.execute不能用recordcount,你要用rs.open"select conut(*) as num from product where bigclass='"&BigClassName&"' and (smallclass='"&SmallClassName&"') ORDER BY id DESC")
",conn,1
set rs=conn.execute("SELECT count(*) FROM product where bigclass='"+BigClassName+"' and (smallclass='"+SmallClassName+"')
if not rs.eof then
pronum=rs.recordcount
end if