asp输出只显示table内容,不显示数据库里的数据
<!--#include file="conn.asp" --><table width="877" height="22" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#999999">
<form name="search_index" action="admin_xxcx.asp?action=ok" method="post" >
<table width="464" height="21" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#999999">
<tr>
<td width="510" align="center" bgcolor="#609B95" class="l11"><strong>信 息 查 询</strong></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="460" border="0" align="center">
<tr>
<td width="220" align="right" class="p12"><label>
<img src="image/find.gif" alt="搜索" width="45" height="18" />
<input name="keyword" type="text" onFocus="this.value=''" value="关 键 词"onmouseover="this.style.background='#F4FBF4';" onMouseOut="this.style.background='#FFFFFF'" />
</label></td>
<td width="154" class="p12"> <label>
<select name="typeid" id="typeid">
<option value="1">变电站名</option>
<option value="2">运行编号</option>
<option value="3">电压等级</option>
<option value="4">试验日期</option>
</select>
</label></td>
<td width="100" class="p12"><label>
<input name="submit" type="submit" id="submit" value="查询" />
</label></td>
</tr>
</table></td>
</tr>
</table>
<%
keyword=replace(replace(replace(replace(replace(trim(request("keyword")),"'",""),"<","("),">",")"),">",")"),"<","(")
typeid=replace(replace(replace(replace(replace(trim(request("typeid")),"'",""),"<","("),">",")"),">",")"),"<","(")
%>
</form>
<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>
<tr>
<% if action="ok" then %>
<%set rsstudent=server.createobject("adodb.recordset")
xsxx=1
if keyword="" then
response.redirect "index.asp"
end if
if typeid="1" then
sqlsbmp="select * from sbmp where name like '%"&keyword&"%' order by adid desc"
end if
if typeid="2" then
sqlsbmp="select * from sbmp where class like '%"&keyword&"%' order by adid desc"
end if
if typeid="3" then
sqlsbmp="select * from sbmp where spcialty like '%"&keyword&"%' order by adid desc"
end if
if typeid="4" then
sqlsbmp="select * from sbmp where Source_school like '%"&keyword&"%' order by adid desc"
end if
rssbmp.open sqlsbmp,conn,1,1%>
<%if rssbmp.eof and rssbmp.bof then%>
<%response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 抱歉没有找到您想要的数据!');window.location.href='admin_xxcx.asp';</script>"%>
<%else%>
<%i=0%>
<%do while not rssbmp.eof or rssbmp.bof %>
<%i=i+1%>
<td height="22" align="center" bgcolor="#FFFFFF" class="p11"><%=rssbmp("flagb")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%=rssbmp("bname")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%=rssbmp("ynum")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%=rssbmp("dydj")%></td>
<td align="center" bgcolor="#FFFFFF" class="p12"><span class="p11"><%=rssbmp("Sdate")%></span></td>
<td align="center" bgcolor="#FFFFFF" class="p12"><strong class="red"><a href="printreport.asp?adid=<%=rssbmp("flagb")%>">详 细</a></strong></td>
</tr>
<% rsstudent.movenext %>
<%loop%>
<%end if%>
</table>
<table width="877" border="0" cellpadding="1" cellspacing="1" bordercolor="#609B95" bgcolor="#999999">
<tr>
<td valign="bottom" bgcolor="#609B95" class="l11"><div align="center"><img src="image/zg.gif" alt="总共" width="45" height="18" /><%=rsstudent.recordcount%><img src="image/tjl.gif" alt="条记录" width="60" height="18" /><img src="image/my.gif" alt="每页" width="40" height="18" /><%=rsstudent.pagesize%><img src="image/p.gif" alt="篇" width="20" height="18" /> <img src="image/d.gif" alt="第" width="20" height="18" /><%=page%><img src="image/dg.gif" alt="页/共" width="60" height="18" /><%=rsstudent.pagecount%><img src="image/y.gif" alt="页->" width="35" height="18" />
<%if page = "1" then%>
<img src="image/sy.gif" alt="首页" width="36" height="18" /> <img src="image/syy.gif" alt="上一页" width="60" height="18" />
<%else%>
<a href="admin_xxcx.asp"><img src="image/sy.gif" alt="首页" width="36" height="18" border="0" /></a><a href="admin_xxcx.asp?page=<%=page-1%>"><img src="image/syy.gif" alt="上一页" width="60" height="18" border="0" /></a>
<%end if%>
<%if rsstudent.pagecount-page < 1 then%>
<img src="image/xyy.gif" alt="下一页" width="60" height="18" /><img src="image/wy.gif" alt="尾页" width="40" height="18" />
<%else%>
<a href="admin_xxcx.asp?page=<%=page+1%>"><img src="image/xyy.gif" alt="下一页" width="60" height="18" border="0" /></a><a href="admin_xxcx.asp?page=<%=rsstudent.pagecount%>"><img src="image/wy.gif" alt="尾页" width="40" height="18" border="0" /></a>
<%end if%>
<a href="admin_student_dy.asp" class="red"><img src="image/dysj.gif" alt="打印数据" width="80" height="18" border="0" /></a> <a href="admin_xzksmc.asp"></a></div></td>
</tr>
</table>
</table>
<%end if%>
注:我的数据库是文件report.mdb
表:sbmp 设备铭牌
字段:flagb 自动ID
bname 变电站名称
ynum 运行编号
sdate 试验日期
dydj 电压等级