林肯公园 发布留言 2008-11-19 22:19
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"
"
response.Write"没有要查询的记录"
response.Write""
else
response.Write"
"
response.Write""
response.Write"图书编号 | "
response.Write"图书名称 | "
response.Write"借书证号 | "
response.Write"读者姓名 | "
response.Write"借出日期 | "
response.Write"
"
do while not rs.eof
response.Write""
response.Write""&rs("tsbh")&" | "
response.Write""&rs("tsmc")&" | "
response.Write""&rs("jszh")&" | "
response.Write""&rs("dzxm")&" | "
response.Write""&rs("jcrq")&" | "
response.Write"
"
rs.movenext
loop
response.Write"
"
end if
%>
运行 时显示 数据库信息
可是在运行 网页:
<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">
借出图书查询
借 出 图 书 查 询
点击查询却 显示无结果!!! 请问什么的情况?
页: [1]