ASP读取记录总数的方法
作者:随然 日期:2009-01-12
方法一:
复制内容到剪贴板
程序代码

Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from student where class_no='7' order by stu_no asc"
rs.open sql,conn,1,1
zongshu=rs.recordcount
rs.close
sql="select * from student where class_no='7' order by stu_no asc"
rs.open sql,conn,1,1
zongshu=rs.recordcount
rs.close
方法二:
复制内容到剪贴板
程序代码

Set rs=Server.CreateObject("ADODB.Recordset")
sql="select count(*) as zongshu from student where class_no='7' order by stu_no asc"
rs.open sql,conn,1,1
zongshu=rs("zongshu")
rs.close
sql="select count(*) as zongshu from student where class_no='7' order by stu_no asc"
rs.open sql,conn,1,1
zongshu=rs("zongshu")
rs.close
[本日志由 随然 于 2009-01-12 00:42 AM 编辑]






评论: 0 | 引用: 0 | 查看次数: 15935
发表评论