我学ASP两天,现在想做个留言板,源码如下,自己看都比较垃圾,现在在第二次查询的时候老提示类型不对,大家帮我看看
<html>
<head>
<style type="text/css">
<!--
.STYLE1 {
font-size: x-large;
color: #0000FF;
font-weight: bold;
}
.STYLE2 {font-size: small; color: #000000; }
body {
background-image: url(img/001.jpg);
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<p align="center" class="STYLE1">留言板</p>
<p align="right" class="STYLE2"><a href="new.html">发表新主题</a></p>
<p align="right" class="STYLE2"><a href="admin.asp">留言管理</a></p>
<p align="right" class="STYLE2"> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("database/db1.mdb")
%>
<%
exec="select * from ly1"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<div align="center">
<%do while not rs.eof%>
<table border="1" align="center" bordercolor="#66FFFF" bgcolor="#66FFCC">
<tr>
<%dd=rs("id")%>
<%session("y")=dd%>
<td><%=rs("zhuti")%></td>
<td><%=rs("name")%></td>
<td><%=rs("tem")%></td><tr>
<td><%=rs("inf")%></td></tr>
</tr>
<%bb=session("y")
set con=server.createobject("adodb.connection")
con.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("database/db1.mdb")
exee="select * from ly2 where id="+bb
set rss=server.createobject("adodb.recordset")
rss.open exee,con,1,1
do while not rss.eof
%>
<tr>
<td>
<table><tr>
<td><%=rss("zhuti")%></td>
<td><%=rss("name")%></td>
<td><%=rss("tem")%></td><tr>
<td><%=rss("inf")%></td></tr>
</tr>
</table></td>
<tr>
<%
rss.movenext
loop
rss.close%>
<%
rs.movenext
loop
rs.close
%>
</table>
</div>
</body>
</html>