asp关于题目链接链接内容的问题?

来源:百度知道 编辑:UC知道 时间:2024/06/17 08:25:09
这是我的读取题目页面:example4.asp
<!--#include file="conn.asp"-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%do while not rs.eof%><tr>
<table border="1" width="862" height="117">
<tr>
<td height="111" width="385"><a href="new.asp?id=<%=rs("id")%>"><%=rs("name")%></a></td>
</tr>
<%
rs.movenext
loop
%>
这是我的读取内容页面new.asp
<!--#include file="conn.asp"-->
<% sql="select * from guestbook where id="&request("id")
res.open sql,con,1,3
if not res.eof then
%>
<%=res("liuyan")%></td></table><% end if
res.close%>
可是显示不出liuyan来,请各位帮办忙看一下改怎么办,还是我的代码哪儿错了?

看点:你第一个页面读出ID来了吗
如果读出ID的话,第二个页面是没有问题的,看你第二页有什么错误提示没有,比如缺少什么什么等
看点:你第二个页面写的代码已经落后了。照我下面所写:
<%
set res=conn.execute("select * from guestbook where id="&request("id"))
while not res.eof
%>
<%=res("liuyan")%>
<%
res.movenext
wend
res.close
set res=nothing
%>
如果照你的写法,还应加上set res=nothing