asp 循环遇到问题了

来源:百度知道 编辑:UC知道 时间:2024/09/12 21:21:14
我用了句循环语句while not recordset.eof显示数据库的信息,信息有些内容要点击该信息标题才可见。但我设计的asp中,随便点击一个标题全部内容都出来了。代码如下:请各位大哥帮我修改好。

<!-- #include file="mdb.asp"--> //这引用的是连接数据库。
<body>
<table width="586" height="576" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" background="images/1.jpg"><br>公告<hr width="90%"><table width="586" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td><form name="form1" method="post" action="">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<%
set rst=server.CreateObject("adodb.recordset")
rst.open

<%
set rst=server.CreateObject("adodb.recordset")
rst.open "select * from gonggao where 索引="&传过来的ID值&"",conn,1,1
if not rst.eof
%>
<tr>
<td width="81%" align="left"><a href="gonggao.asp?act=dakai"> <%=rst("g_bt")%></a></td>
<td width="19%" align="right" valign="middle"><%=rst("g_sj")%></td>
</tr>
<%if request.QueryString("act")="dakai" then%>
<tr>
<td colspan="2"> <%=rst("g_nr")%></td>
</tr>
<%end if%>
<%
end if
rst.close
%>