查看完整版本: [-- Asp+access 如何统计 数据库里的记录条数? --]

-> 电脑技术 -> Asp+access 如何统计 数据库里的记录条数? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

yycadmin 2014-05-22 16:55

Asp+access 如何统计 数据库里的记录条数?


<%=rs.recordcount%>

必须用OPEN来打开!  
   set    rs_lea=Server.CreateObject("ADODB.Recordset")              
   rs_lea.open    sql_lea,ConnStr,1,1

   '#    定义数据库通道set    con=Server.CreateObject("ADODB.connection")  
   '#    定义记录集set    rs=Server.CreateObject("ADODB.Recordset")              
   cn.open    "………………"  
   '#    统计方法一  
   strSql="select    count(*)    from    表名"  
   rs.open    strSql,1,1  
   response.write    "共有记录:"    &    rs(0).value  
   ’统计方法二  
   rs.open    "select    *    from    表名"  
   rs.open    strSql,1,3    '#参数为3  
   response.write    "共有记录:"    &    rs.recordcount

   #    参数应该为  
   rs_lea.open    sql_lea,ConnStr,1,3  
   或者用  
   rs_lea.open    "select    count(*)    from    table",connStr,1,1  
   response.write    "totle:"    &    rs_lea(0).value


查看完整版本: [-- Asp+access 如何统计 数据库里的记录条数? --] [-- top --]


Powered by phpwind v8.7 Code ©2003-2011 phpwind
Time 0.022187 second(s),query:1 Gzip disabled