3个回答
推荐于2017-10-25 · 知道合伙人数码行家
关注
展开全部
用Loop,代码如下:
<%rs.Open "Select * From data where libo=2 Order By time DESC", conn, 1,3
if rs.eof and rs.bof then
%>
暂时没有任何记录!!
<%
else
%>
<table width="1020" border="0" align="center" background="bodybg.gif">
<tr>
<td><table border="0" width="770" cellpadding="1" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#999999" align="center">
<tr>
<td height="65" align="center" valign="middle" scope="col"><span class="STYLE1"><span class="STYLE2"><img src="share.png" width="100" height="25"></span> { <%=jishu%> }</span>
<hr></td>
</tr>
</table>
<table width="770" border="0" align="center" cellpadding="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF">
<%I=0
p=RS.PageSize*(Curpage-1)
do while (Not RS.Eof) and (I<RS.PageSize)
p=p+1%>
<tr>
<td height="36" align=left bordercolorlight="#C0C0C0"><p> <img src=../images/ico/share.png width="14" height="17" align="absmiddle"><font color=#0066CC> 分享号:</font>SHARE00<%=rs("id")%> <font color=#0066CC>贡献者:</font><%=rs("ren")%>
<font color=#0066CC>加入时间:</font><%=rs("time")%>
</br> </br>
<hr> </td>
</tr>
<%
RS.MoveNext
Loop%>
<%rs.Open "Select * From data where libo=2 Order By time DESC", conn, 1,3
if rs.eof and rs.bof then
%>
暂时没有任何记录!!
<%
else
%>
<table width="1020" border="0" align="center" background="bodybg.gif">
<tr>
<td><table border="0" width="770" cellpadding="1" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#999999" align="center">
<tr>
<td height="65" align="center" valign="middle" scope="col"><span class="STYLE1"><span class="STYLE2"><img src="share.png" width="100" height="25"></span> { <%=jishu%> }</span>
<hr></td>
</tr>
</table>
<table width="770" border="0" align="center" cellpadding="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF">
<%I=0
p=RS.PageSize*(Curpage-1)
do while (Not RS.Eof) and (I<RS.PageSize)
p=p+1%>
<tr>
<td height="36" align=left bordercolorlight="#C0C0C0"><p> <img src=../images/ico/share.png width="14" height="17" align="absmiddle"><font color=#0066CC> 分享号:</font>SHARE00<%=rs("id")%> <font color=#0066CC>贡献者:</font><%=rs("ren")%>
<font color=#0066CC>加入时间:</font><%=rs("time")%>
</br> </br>
<hr> </td>
</tr>
<%
RS.MoveNext
Loop%>
更多追问追答
追问
。。。 如图我该怎么改?根本看不懂你给的~~ libo、分享号、贡献者这些都是些什么东西~~~~
追答
这是另外一个程序的代码,分享号***这些都是对应的字段名。
你有ASP的基础吧?你把里面的字段名换成你自己的就好了。
打开单条记录和多条记录的区别就是加了循环读取
RS.MoveNext
Loop
展开全部
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select top N * from [表名] Order By ID desc",conn,1,1 'N是输出条数
if rs.eof and rs.bof then
response.write "<center>目前还没有内容!</center>"
else
do while not rs.eof
response.write "输出内容"
rs.movenext
loop
end if
rs.close
set rs=nothing %>
set rs=server.CreateObject("adodb.recordset")
rs.open "select top N * from [表名] Order By ID desc",conn,1,1 'N是输出条数
if rs.eof and rs.bof then
response.write "<center>目前还没有内容!</center>"
else
do while not rs.eof
response.write "输出内容"
rs.movenext
loop
end if
rs.close
set rs=nothing %>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询