最后一条记录特殊显示继续问 50分 急

cp713 2009-11-09 11:20:19
<%
Set rs= Server.CreateObject("ADODB.recordset") '创建打开对象
rs.open "Select * from 产品中心",lj,1,1
Do until rs.eof
mc=rs("mc")
Rs.movenext
if rs.eof then mc=mc&"最后一条记录"
Response.Write mc
Loop
rs.close
set rs=nothing
lj.close
set lj=nothing
%>
上面是上次得到的回答 还有没有另外种写法
这种写法如果在if rs.eof then这里敲个回车就出现错误了
如果我在这里写个表格呢 那肯定要敲回车的
比如
if rs.eof then%>
<table cellspacing="0" cellpadding="0">
<tr>
<td><% =rs("mc") %></td>
</tr>
</table><%
这样这句话就错误了
...全文
88 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yyh112 2009-11-09
  • 打赏
  • 举报
回复
if rs.eof then%>
<table cellspacing="0" cellpadding="0">
<tr>
<td> 最后一条记录 </td>
</tr>
</table> <%
else
yyh112 2009-11-09
  • 打赏
  • 举报
回复
if rs.eof then%>
<table cellspacing="0" cellpadding="0">
<tr>
<td> <% =rs("mc") %> </td>
</tr>
</table> <%
else
yyh112 2009-11-09
  • 打赏
  • 举报
回复
在if rs.eof then这里敲个回车就出现错误了
敲个回车 就要把 if 结束啊

else
。。。
end if
lzp4881 2009-11-09
  • 打赏
  • 举报
回复
<%
Set rs= Server.CreateObject("ADODB.recordset") '创建打开对象
rs.open "Select * from 产品中心",lj,1,1
Do until rs.eof
mc=rs("mc")
Rs.movenext
if rs.eof then
mc=mc&"最后一条记录"
end if
Response.Write mc
Loop
rs.close
set rs=nothing
lj.close
set lj=nothing
%>

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧