asp 连接数据库语句??

来源:百度知道 编辑:UC知道 时间:2024/06/17 02:51:01
这段是统计实用英语这个栏目的文章个数的.
提示这句话有错:rscount.open "Select count * From News Where BigClassName='实用英语'",conn,1,1

错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

<table cellspacing="1" cellpadding="4" width="100%" align="center">
<tr>
<td width="100%" class="header"><div align="center">站内统计</div></td>
</tr>

<%
set rscount=server.CreateObject("adodb.recordset")
rscount.open "Select count * From News Where BigClassName='实用英语'",conn,1,1

%>
<tr>
<td width="100%"><div align="center"><%=rscount(0)%></div></td>
</tr>
<%

rscount.close
set rscount=nothing

%>
</table>

select count(*) from news where BigClassName='实用英语'

select count(*) from news where BigClassName='实用英语'
这句什么意思。要么有count要么是*,你都有,是查询count字段又查询所有字段,这样矛盾吗不是?
去掉一个。

然后rscount.recordcount不就得到数目了吗!