红色横幅cmyk值:asp sql server数据统计问题

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 10:53:52
dim count1,
set rs=Server.Createobject("ADODB.Recordset")
rs.open "select * from mail where muser='"+Session("studentid")+"'",conn,1,3
count1=rs.recordcount

我用sql server 作数据库想统计符合条件的记录总数,但是按上面的写法只作显示count1结果为0
我用access作数据库时是可以正确统计的.请问为什么用sql server 作数据库时统计不了?如何写才能正确统计呢?谢谢

dim count1,
set rs=Server.Createobject("ADODB.Recordset")
把“+”换成"&"
rs.open "select * from mail where muser='"+Session("studentid")+"'",conn,1,3 这里 用 “1” 就可以了
count1=rs.recordcount