求救!拜托各位了。
我想让系统总出找到的记录总数,明明找到三条记录,可是系统显示为-1条,下面是代码,感谢!
<% @ Language = VBScript %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<div align="center">
<center>
<table border="1" width="802" height="33" cellspacing="0" cellpadding="0" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000">
<tr>
<td width="147" height="33" align="center"><font size="5">国别</font></td>
<td width="649" height="33" align="center"><font size="5">人数</font></td>
</tr>
</table>
</center>
</div>
<%
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open"db1"
Set rs = Server.CreateObject("ADODB.Recordset")
SQLstr="select * from db1"
Set rs=Conn.Execute(SQLstr)
%>
<%
if rs.bof and rs.eof then
Response.write "<font color=red>对不起,目前您没有任何发送或收到的信息!</font>"
else
end if
%>
<div align="center">
<% While rs.EOF=False%>
<center>
<table border="1" width="803" height="44" bordercolorlight="#C0C0C0" cellspacing="0" cellpadding="0" bordercolordark="#C0C0C0" bordercolor="#C0C0C0">
<tr>
<td width="143" height="44" align="center"><font size="5"><%=rs.Fields("a")%></font></td>
<td width="644" height="44" align="center"><font size="5"><%=rs.Fields("b")%></font></td>
</tr>
</table>
</center>
</div>
<%
rs.MoveNext
Wend
%>
总共搜索到<%=rs.RecordCount%>条记录
</html>
<%
rs.Close
Conn.Close
%>