标题:新问题!
取消只看楼主
belin2000
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:975
专家分:194
注 册:2004-6-2
结帖率:0
 问题点数:0 回复次数:3 
新问题!

<!--#include file="conn.asp"--> <!--#include file="fenye1.asp"--> <% bookn=request("bookn") leibie=request("leibie") 'response.write leibie outtime=request("outtime") chubanshe=request("chubanshe") if bookn="" then response.write("关键字不能为空") else session("a")=request("bookn") bookn=session("a") end if if leibie="所有" and outtime="所有" and chubanshe="所有" then sql="select * from allbook where bookname = '"&bookn&"' or bookname like '%bookn%' order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") '改为分页程序就可以了,建议用包含 end if elseif leibei<>"所有" and outtime="所有" and chubanshe="所有" then sql1="select * from allbook where leibie= '"&leibie&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql1,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei<>"所有" and outime<>"所有"and chubanshe="所有" then sql2="select * from allbook where leibie= '"&leibie&"' and outtime='"&outtime&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql2,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei<>"所有" and outime<>"所有"and chubanshe<>"所有" then sql3="select * from allbook where leibie= '"&leibie&"' and outtime='"&outtime&"' and chubanshe='"&chubanshe&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql3,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei="所有" and outime<>"所有"and chubanshe="所有" then sql4="select * from allbook where outtime='"&outtime&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql4,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei="所有" and outime<>"所有"and chubanshe<>"所有" then sql5="select * from allbook where outtime='"&outtime&"' and chubanshe='"&chubanshe&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql5,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei="所有" and outime="所有"and chubanshe<>"所有" then sql6="select * from allbook where chubanshe='"&chubanshe&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql6,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if end if %> <% sub closers rs.close set rs=nothing end sub%> 为什么我运行第二页就提示:关键字不能为空对不起,没有你要找的记录! 返回

搜索更多相关主题的帖子: request include border 关键字 color 
2004-06-20 16:40
belin2000
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:975
专家分:194
注 册:2004-6-2
得分:0 

你想到怎么传递参数吗?

if bookn="" then response.write("关键字不能为空") else session("a")=request("bookn") bookn=session("a") end if


59ita点com(我就爱TA)
2004-06-20 17:22
belin2000
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:975
专家分:194
注 册:2004-6-2
得分:0 

if bookn="" then 'response.write("关键字不能为空") bookn=session("a") else session("a")=request("bookn") end if

你没有写进session("a")怎么读出来!

[此贴子已经被作者于2004-06-20 19:02:38编辑过]


59ita点com(我就爱TA)
2004-06-20 19:01
belin2000
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:975
专家分:194
注 册:2004-6-2
得分:0 
以下是引用大光在2004-06-21 08:11:18的发言:

if bookn="" then 'response.write("关键字不能为空") bookn=session("a") else session("a")=request("bookn") '这条就是写进,第一次从request里面读,然后写到session里,以后就直接从session里面读就行了。end if

还是有问题,你不觉得吗?如果以开始就为空,会怎么样?我们还是讨论一下


59ita点com(我就爱TA)
2004-06-21 19:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-2709-1-1.html




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

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