求救!换行问题?

vigoryouth 2005-11-02 09:17:50
我想把查询出来的记录显示在四个格里,但没有成功,
请大家帮忙看看是哪里错了
<table cellpadding="3" width="95%" border="0" cellspacing="3">

<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from article where boardid in ("&request("boardid")&")",conn,1,1
if rs_s.recordcount=0 then
%>

<tr>
<td width="90%" colspan="4">暂无文章
</td>
</tr>

<%
else
while not rs_s.eof
%>

<tr>
<td width="20%" height="16" >
<% if not rs_s.eof then %>
<a href="booksnew.asp?id=<%=rs("id")%>"><%=rs("Title")%></a>
</td>

<%rs_s.movenext
end if%>
<td width="20%" height="16" >
<% if not rs_s.eof then %>
<a href="booksnew.asp?id=<%=rs("id")%>"><%=rs("Title")%></a>
</td>
<%rs_s.movenext
end if%>
<td width="20%" height="16" >
<% if not rs_s.eof then %>
<a href="booksnew.asp?id=<%=rs("id")%>"><%=rs("Title")%></a>
</td>
<%rs_s.movenext
end if%>
<td width="20%" height="16" >
<% if not rs_s.eof then %>
<a href="booksnew.asp?id=<%=rs("id")%>"><%=rs("Title")%></a>
</td>
</tr>
<%
rs_s.movenext
end if%>
<%
wend
end if
rs_s.close
set rs_s=Nothing
%>
</table>

错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/xx/xx.asp, 第 5 行

我把前面改成
<table cellpadding="3" width="95%" border="0" cellspacing="3">
<%
set rs_s=server.createobject("adodb.recordset")
exec="select * from article where boardid in ("&request("boardid")&")"
rs_s.open exec,conn,1,1
if rs_s.recordcount=0 then
%>
也是一样出错,
请朋友们帮忙~~~~
...全文
142 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
legend1970 2005-11-04
  • 打赏
  • 举报
回复
与if rs_s.recordcount=0 then 配对的end if 加在wend 后面就可以了!!





monkeyhjl 2005-11-04
  • 打赏
  • 举报
回复
wend 后面加end if
vigoryouth 2005-11-04
  • 打赏
  • 举报
回复
先谢谢楼上的朋友了,不过问题我还没有搞定啊
数据库连结文件已经包含进来了(不好意思,发贴的时候忘了写了^)^
我把“偶不懂就来问”的代码一字不漏的抄下,也出错了,说是“wend"这里缺少语句

legend1970 2005-11-03
  • 打赏
  • 举报
回复
上面写错了一句:
<table cellpadding="3" width="95%" border="1" cellspacing="3">
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from article where boardid in ("&request("boardid")&")",conn,1,1
if rs_s.recordcount=0 then
%>

<tr>
<td width="90%" colspan="4">暂无文章
</td>
</tr>
<tr>

<%
else
k=1
while not rs_s.eof
%>
<td width="20%" height="16" >
<%if not rs_s.eof then %>
<a href="booksnew.asp?id=<%=rs("id")%>"><%=rs("Title")%></a>
</td>

<%
k=k+1
if k>4 then
%>
</tr>
<tr>
<%
k=1
end if
rs_s.movenext
wend
rs_s.close
set rs_s=Nothing
%>
</table>
legend1970 2005-11-02
  • 打赏
  • 举报
回复
就这样就行了!!!!!!!!
<table cellpadding="3" width="95%" border="1" cellspacing="3">
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from article where boardid in ("&request("boardid")&")",conn,1,1
if rs_s.recordcount=0 then
%>

<tr>
<td width="90%" colspan="4">暂无文章
</td>
</tr>
<tr>

<%
else
k=1
while not rs_s.eof
%>
<td width="20%" height="16" >
<%if not rs_s.eof then %>
<%=i&K%>
</td>

<%
k=k+1
if k>4 then
%>
</tr>
<tr>
<%
k=1
end if
rs_s.movenext
wend
rs_s.close
set rs_s=Nothing
%>
</table>
hxyman 2005-11-02
  • 打赏
  • 举报
回复
你检查一下看你的数据库连结文件是否包含进来了

28,406

社区成员

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

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