有错,求救,帮忙改正一下,在线等!

zjwhwly 2005-12-09 11:02:10
答复对象 错误 'ASP 0104 : 80070057'

不允许操作

/imitate/gaoxiao.asp,行0
我以前做的都是行与行之间的循环,现在这里想实现的是一行有两列,然后行与行之间的循环。代码如下:

<!--#include file="inc/conn.asp"-->
<%j=0
sql="select top 4 * from song where class='歪唱搞笑'and isrecommend=1 order by renqi desc"
set rs_tj=server.CreateObject("adodb.recordset")
rs_tj.open sql,conn,1,3

%><table width="100%" height="318" border="0" bgcolor="#DBDBDB">
<tr>
<td height="30" bgcolor="#FFFFFF">搞笑推荐</td>
</tr>

<tr>
<%do while not rs_tj.eof

%>
<td width="50%" height="75" valign="top" bgcolor="#FFFFFF"><table width="47%" border="0">
<tr>
<td width="31%" height="25">歌手:</td>
<td width="69%"><%=rs_tj("nickname")%></td>


</tr>
<tr>
<td height="25">歌曲:</td>
<td><%=rs_tj("song")%></td>
</tr>
<tr>
<td height="25">人气:</td>
<td><%=rs_tj("renqi")%></td>
</tr>

</table></td>
<%


j=j+1
if j mod 2=0 then response.write "</tr><tr>"

loop
%>
</tr>
</table>
发现错误后,我测试了一下,在 <%


j=j+1
if j mod 2=0 then response.write "</tr><tr>"

loop
%>
之前都能正常显示,我把 <%j=j+1
if j mod 2=0 then response.write "</tr><tr>"%>屏蔽掉,还是那个答复对象错误提示。但是loop放在那里应该没问题啊,搞不清是什么原因。请高手帮帮我啊,正在郁闷中!

...全文
41 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jspadmin 2005-12-09
  • 打赏
  • 举报
回复
loop前加上end if 和rs_tj.movenext 你的if没有结束,并且游标没有移动
----------------------------------------------------------------------
我以热心、耐心、真诚和时间申请当版主,支持我的请进!
http://community.csdn.net/Expert/topic/4447/4447054.xml?temp=.3835565
rebacca1620 2005-12-09
  • 打赏
  • 举报
回复
<%
sql="..."
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.eof then
mycount=1
while not rs.eof
%>
...
<%
if mycount mod (2) = 0 then
%>
</tr>
<tr>
<%
end if
mycount=mycount+1
rs.movenext
wend
else
...
end if
rs.close
set rs=nothing
%>

28,390

社区成员

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

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