这个asp代码怎么改?谢谢!

youcailing 2003-10-16 05:59:43
<!--#include file="conn.asp"-->

<%

if request("classid")="" then
response.write"<center><br><br><font color=red>您所专题不是报刊专题!</font><br><br>"
else
set rs1 = server.CreateObject ("Adodb.recordset")
sql="select topicid,topicname from topic where classid = " & request("classid") &"order by topicid desc"
rs1.open sql,conn,1,1

set rs = server.CreateObject ("Adodb.recordset")
sql="select title from article where topicid="&("rs1(topicid)")&" order by id desc"
rs.open sql,conn,1,1
for i = 1 to 15
if RS.EOF then exit for
%>
<li><a href=/news/topiclist.asp?topid=<%=rs1("topicid")%> ><%=rs1("topicname")%></a><br>
<%
rs.MoveNext()
next
rs.close
set rs = nothing
end if

rs1.close
set rs1=nothing

end if
%>
...全文
34 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
youcailing 2003-10-17
  • 打赏
  • 举报
回复
我调用这个页面的时候是这样调用的:../news/zt.asp?classid=1,但是,他不显示呢,我数据库中有满足条件的记录啊
htao007 2003-10-17
  • 打赏
  • 举报
回复
rs.MoveNext()-------- rs.MoveNext

'''''''''''''''''''''''
end if

rs1.close''''''''''''''''去掉上面的 end if
angelheavens 2003-10-17
  • 打赏
  • 举报
回复
去掉rs1.close语句上面的end if
chjpeng 2003-10-17
  • 打赏
  • 举报
回复
sql="select topicid,topicname from topic where classid = " & request("classid") &"order by topicid desc"
rs1.open sql,conn,1,1

改成
sql="select topicid,topicname from topic where classid = " & request("classid") & " order by topicid desc"
rs1.open sql,conn,1,1

試試,提示錯誤是什么?
lyywxl 2003-10-17
  • 打赏
  • 举报
回复
不用
if RS.EOF then exit for

的end if
因为你是一行

say1no2 2003-10-17
  • 打赏
  • 举报
回复

sql="select topicid,topicname from topic where classid = " & request("classid") &"order by topicid desc"
改成
sql="select topicid,topicname from topic where classid = " & request("classid") & " order by topicid desc"
bananasmiling 2003-10-17
  • 打赏
  • 举报
回复
什么地方语法错误??
youcailing 2003-10-16
  • 打赏
  • 举报
回复
我说语法错误
kxyes 2003-10-16
  • 打赏
  • 举报
回复
你要改什么??
qdubit 2003-10-16
  • 打赏
  • 举报
回复
up!

28,390

社区成员

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

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