ASP由列表显示详细页面的代码,谁帮我修改一下
急急急!!!改来改去把代码改坏了。以前从列表显示“详细”页面,但是传参ID不对。显示出来的都是同一个“详细”页面。现在显示不出来了代码如下:
reportlist.asp
<!--#include file="conn.asp" -->
<table width="877" height="22" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#999999">
<tr>
<td width="8%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>序 号</strong></td>
<td width="12%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>变电站名</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>运行编号</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>电压等级</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>试验日期</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>点击查看</strong></td>
</tr>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open"select top 30 * from sbmp",conn,1,1
flagb=rs("flagb")
rs.movefirst
%>
<%do while not rs.eof or rs.bof%>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("flagb"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("bname"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("ynum"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p12"><span class="p11"><%response.write(rs("dydj"))%></span></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("sdate"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write " <a href ='print.asp?flagb="&flagb&"' Target=_blank >详细页面</a>"%></td>
</tr>
<%flagb=flagb+1%>
<%rs.movenext%>
<%loop%>
<%rs.close%>
<%set rs=nothing%>
</table>
</table>
print.asp
<!--#include file="conn.asp"-->
<%
flagb=request ("flagb")
set rs=server.CreateObject("adodb.recordset")
sql="select * from where flagb="&flagb
rs.open sql,conn,2,3
rs.movefirst
if not rs.eof then
response.write(rs("bname"))
end if
rs.movenext
rs.close
rs=nothing
%>
注:我的数据库是文件report.mdb
表:sbmp 设备铭牌
字段:flagb 自动ID
bname 变电站名称
ynum 运行编号
sdate 试验日期
dydj 电压等级