| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 670 人关注过本帖
标题:asp输出只显示table内容,不显示数据库里的数据
只看楼主 加入收藏
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
结帖率:75%
收藏
已结贴  问题点数:20 回复次数:2 
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">&nbsp; &nbsp; <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")),"'",""),"<","("),">",")"),"&gt;",")"),"&lt;","(")
        typeid=replace(replace(replace(replace(replace(trim(request("typeid")),"'",""),"<","("),">",")"),"&gt;",")"),"&lt;","(")
        %>
      </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" />&nbsp;&nbsp;<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="页-&gt;" 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>&nbsp; <a href="admin_xzksmc.asp"></a></div></td>
          </tr>
      </table>
    </table>
   
        <%end if%>
注:我的数据库是文件report.mdb
表:sbmp 设备铭牌
字段:flagb  自动ID
      bname  变电站名称
      ynum   运行编号
      sdate  试验日期
      dydj   电压等级
         
搜索更多相关主题的帖子: 数据库 asp include action border 
2012-12-24 18:40
hubowei
Rank: 3Rank: 3
等 级:论坛游侠
威 望:2
帖 子:31
专家分:179
注 册:2012-12-11
收藏
得分:10 
<%set rsstudent=server.createobject("adodb.recordset")
rssbmp.open sqlsbmp,conn,1,1%>
???

心情半佛半神仙
2012-12-25 07:48
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:10 
楼上说的很对,应该是这两句不一致引起的。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2012-12-25 08:41
快速回复:asp输出只显示table内容,不显示数据库里的数据
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028392 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved