<%
exec="select top 5 * from liu order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
为什么显示效果只有一条,我的 数据库里有很多条信息啊!
<div align="left">
<%
set rs=server.CreateObject("adodb.recordset")
strsql="select top 10 * from Merchant order by id desc"
rs.open strsql,conn,3,3
set ra=server.CreateObject("adodb.recordset")
sql="select count(ID) as aa from Merchant "
ra.open sql,conn,3,3
%>
截止(<%=Date()%>),共有<font color="#FF0000"><%=ra("aa")%></font>个会员 <br>
</div>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="left">商家名</div></td>
<td width="45%"><div align="center">加入时间</div></td>
</tr>
<%do while not rs.eof%>
<tr>
<td><div align="left"><a href="/user/index.asp?id=<%=rs("id")%>"><%=Left(rs("Name"),5)%>..</a></div></td>
<td align="left" width="45%"><div align="center"><%=rs("Date")%></div></td>
</tr>
<%
rs.movenext
loop
rs.close()
%>
</table>
这是我做的例子