| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 590 人关注过本帖
标题:B/S图书管理系统 rs=cn.execute select问题
只看楼主 加入收藏
林肯公园
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-11-14
收藏
 问题点数:0 回复次数:0 
B/S图书管理系统 rs=cn.execute select问题
图书管理系统  三个表 tsbm,dzmc,tsjy  代码:
   <%
 Set cn=Server.CreateObject("ADODB.Connection")
     cn.open "provider=sqloledb;server=(local);database=abc;uid=abc;pwd=abc;"
 if request.Form("cxgjzlb")="图书编号"then
    Set rs=cn.Execute("select tsbm.tsbh,tsmc,dzmc.jszh,dzxm,jcrq from tsbm,dzmc,tsjy where tsbm.tsbh=tsjy.tsbh and dzmc.jszh=tsjy.jszh and jcbz='借出' and tsbm.tsbh like '%"&request.Form("cxgjz")&"%'")
elseif request.Form("cxgjzlb")="图书名称"then
    Set rs=cn.Execute("select tsbm.tsbh,tsmc,dzmc.jszh,dzxm,jcrq from tsbm,dzmc,tsjy where tsbm.tsbh=tsjy.tsbh and dzmc.jszh=tsjy.jszh  and jcbz='借出' and tsmc like '%"&request.Form("cxgjz")&"%'")
 elseif request.Form("cxgjzlb")="借书证号"then
    Set rs=cn.Execute("select tsbm.tsbh,tsmc,dzmc.jszh,dzxm,jcrq from tsbm,dzmc,tsjy where tsbm.tsbh=tsjy.tsbh and dzmc.jszh=tsjy.jszh  and jcbz='借出' and dzmc.jszh like '%"&request.Form("cxgjz")&"%'")
 else
    Set rs=cn.Execute("select tsbm.tsbh,tsmc,dzmc.jszh,dzxm,jcrq from tsbm,dzmc,tsjy where tsbm.tsbh=tsjy.tsbh and dzmc.jszh=tsjy.jszh  and jcbz='借出' and dzxm like '%"&request.Form("cxgjz")&"%'")
 end if
 if rs.eof then
    response.Write"<font size='4' color='#0000ff'>"
    response.Write"<center>没有要查询的记录</center>"
    response.Write"</font>"
   else
    response.Write"<table align=center border=1 cellpadding='3' style='font-size:11pt'>"
    response.Write"<tr bgcolor=#d8bfd8>"
    response.Write"<td nowrap align=center>图书编号</td>"
    response.Write"<td nowrap align=center>图书名称</td>"
    response.Write"<td nowrap align=center>借书证号</td>"
    response.Write"<td nowrap align=center>读者姓名</td>"
    response.Write"<td nowrap align=center>借出日期</td>"
    response.Write"</tr>"
    do while not rs.eof
     response.Write"<tr>"
     response.Write"<td>"&rs("tsbh")&"</td>"
     response.Write"<td>"&rs("tsmc")&"</td>"
     response.Write"<td>"&rs("jszh")&"</td>"
     response.Write"<td>"&rs("dzxm")&"</td>"
     response.Write"<td>"&rs("jcrq")&"</td>"
     response.Write"</tr>"
     rs.movenext
    loop
    response.Write"</table>"
 end if
  %>

运行 时显示  数据库信息  
    可是在运行  网页:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>借出图书查询</title>
<script language="VBScript" type="text/VBscript" src="jctscxlb.asp"></script>
</head>

<body bgcolor="#FFFFCC" text="#000000" link="#3366CC" vlink="#666666" alink="#990000">
  <br><br>
  <p align="center">
  <font face="华文行楷" size="+6" color="#FF0000">
  <b>借 出 图 书 查 询</b></font></br>
  <p align="center">
 <form method="post" action="jctscxlb.asp">
  <font face="宋体" color="#0000FF" size="3">
  选择查询关键字类别:
  <select size="1" name="jctscxlb">
    <option>图书编号</option>
    <option>图书名称</option>
    <option>借书证号</option>
    <option>读者姓名</option>
  </select>
  <br><br>
  请 输 入 查 询 关 键 字:
  <input type="text" name="cxgjz" size="9">
  <br><br>
  <input type="submit" value="查  询" name="B1">&nbsp;&nbsp;&nbsp;
  <input type="reset" value="重  选" name="B2">
  </font>
  </form>
  </p>
</body>
</html>
  点击查询却  显示无结果!!!  请问什么的情况?
搜索更多相关主题的帖子: select问题 
2008-11-19 22:18
快速回复:B/S图书管理系统 rs=cn.execute select问题
数据加载中...
 
   



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

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