这段代码错误在哪?(马上结帖)

hollandhut 2006-07-28 09:05:25
<%
set rsd=server.createobject("adodb.recordset")
rsd.open "select top 10 from product order by id desc",conn,1,1
%>

<TR>
<%
if rsd.bof or rsd.eof then response.write"暂时没有产品图片!"
else
do
%>
<td width="17%" valign="top"><a href="productsview.asp?id=<%=rsd("id")%>"><img src="<%=rsd("pic")%>" width="94" height="107" border="0"></a></td>
<%rsd.movenext
loop
end if
%>
</TR>
<%
rsd.close
set rsd=nothing
%>

错误信息Microsoft VBScript compilation 错误 '800a03ea'

Syntax error

/ys1/index.asp,行 55

else
^
...全文
124 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
张三大胖 2006-07-28
  • 打赏
  • 举报
回复
<%
set rsd=server.createobject("adodb.recordset")
rsd.open "select top 10 from product order by id desc",conn,1,1
%>

<TR>
<%
if rsd.bof or rsd.eof then response.write"暂时没有产品图片!"
else
do while not rs.eof
%>
<td width="17%" valign="top"><a href="productsview.asp?id=<%=rsd("id")%>"><img src="<%=rsd("pic")%>" width="94" height="107" border="0"></a></td>
<%rsd.movenext
loop
end if
%>
</TR>
<%
rsd.close
set rsd=nothing
%>
biandande 2006-07-28
  • 打赏
  • 举报
回复
else 后面不用加DO 他是直接运行的,,如果不符合if的条件,,+上else 他直接运行else下面的部分,,,

28,402

社区成员

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

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