| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4791 人关注过本帖
标题:[求助]ADODB.Recordset (0x800A0BB9)
只看楼主 加入收藏
lzf0112
Rank: 1
等 级:新手上路
帖 子:244
专家分:0
注 册:2006-4-9
收藏
 问题点数:0 回复次数:12 
[求助]ADODB.Recordset (0x800A0BB9)

下面是一个有关查询的语句,可是每是预览是都会提示:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
我查对sql语句一个下午也没有找出什么毛病来啊。在网上找了一下解决的办法也不行啊。。。。
麻烦大家帮忙看一下啊。。。。
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
bookname=trim(request("bookname"))
booktype=trim(request("booktype"))
publishing=trim(request("publishing"))
money1=trim(request("money1"))
money2=trim(request("money2"))
if len(bookname)<>0 and booktype<>"不清楚" and len(publishing)<>0 then
sql="select * from book where bookname like '%"&bookname&"%' and booktype='"&booktype&"' and publishing like '%"&publishing&"%' and bookmoney>="&money1&" and bookmoney<="&money2&" order by bookid desc"
end if
if len(bookname)<>0 and booktype<>"不清楚" and len(publishing)=0 then
sql="select * from book where bookname like '%"&bookname&"%' and booktype='"&booktype&"' and bookmoney>="&money1&" and bookmoney<="&money2&" order by bookid desc"
end if
if len(bookname)<>0 and booktype="不清楚" and len(publishing)<>0 then
sql="select * from book where bookname like '%"&bookname&"%' and publishing like '%"&publishing&"%' and bookmoney>="&money1&" and bookmoney<="&money2&" order by bookid desc"
end if
if len(bookname)<>0 and booktype="不清楚" and len(publishing)=0 then
sql="select * from book where bookname like '%"&bookname&"%' and bookmoney>="&money1&" and bookmoney<="&money2&" order by bookid desc"
end if
rs.open sql,conn,1,3 //提示这一句错误啊
%>
<style type="text/css">
<!--
table {
font-size: 9pt;
text-decoration: none;
border: 1px solid #000000;
}
-->
</style>
<%if rs.eof or rs.bof then
response.write "对不起没有搜索到记录"
response.end
else
dim pagenum,i
i=0
rs.pagesize=5
pagecount1=rs.pagecount
if request.querystring("pagenum")=0 or request.querystring("pagenum")="" then
pagenum=1
else
pagenum=request.querystring("pagenum")
rs.absolutepage=trim(request.querystring("pagenum"))
end if
%>
<style type="text/css">
<!--
a {
font-size: 9pt;
text-decoration: none;
}
-->
</style>
<style type="text/css">
<!--
p {
font-size: 9pt;
text-decoration: none;
}
-->
</style>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr align="center" bgcolor="#006699">
<td width="220"><font color="#FFFFFF">书籍名称</font></td>
<td width="181"><font color="#FFFFFF">出版社</font></td>
<td width="102"><font color="#FFFFFF">作者</font></td>
<td width="140"><font color="#FFFFFF">出版日期</font></td>
<td width="91"><font color="#FFFFFF">价格</font></td>
</tr>
<%
do while not rs.eof and i<=5
%>
<tr align="center">
<td><%=rs("bookname")%></td>
<td><%=rs("publishing")%></td>
<td><%=rs("writer")%></td>
<td><%=rs("bookdate")%></td>
<td><font color="#FF0000"><%=rs("bookmoney")%>元</font></td>
</tr>
<%
i=i+1
rs.movenext
loop
rs.close
set rs=nothing
%>
<%end if%>
</table>
<p align="center">
<%
response.write "<a href=select.asp?pagenum=1&bookname="&bookname&"&booktype="&booktype&"&publishing="&publishing&"&money1="&money1&"&money2="&money2&"&date1="&date1&"&date2="&date2&"&date3="&date3&"&date11="&date11&"&date22="&date22&"&date33="&date33&">首页</a>"
%>&nbsp;
<%
if pagenum>1 then
response.write "<a href=select.asp?pagenum="&(pagenum-1)&"&bookname="&bookname&"&booktype="&booktype&"&publishing="&publishing&"&money1="&money1&"&money2="&money2&"&date1="&date1&"&date2="&date2&"&date3="&date3&"&date11="&date11&"&date22="&date22&"&date33="&date33&">上一页</a>&nbsp;"
else
response.write "上一页&nbsp;"
end if
if pagenum<pagecount1 then
response.write "<a href=select.asp?pagenum="&(pagenum+1)&"&bookname="&bookname&"&booktype="&booktype&"&publishing="&publishing&"&money1="&money1&"&money2="&money2&"&date1="&date1&"&date2="&date2&"&date3="&date3&"&date11="&date11&"&date22="&date22&"&date33="&date33&">下一页</a>&nbsp;"
else
response.write "下一页"
end if
%>&nbsp;
<%
response.write "<a href=select.asp?pagenum="&pagecount1&"&bookname="&bookname&"&booktype="&booktype&"&publishing="&publishing&"&money1="&money1&"&money2="&money2&"&date1="&date1&"&date2="&date2&"&date3="&date3&"&date11="&date11&"&date22="&date22&"&date33="&date33&">尾页</a>"
%>
</p>

搜索更多相关主题的帖子: Recordset ADODB trim request 
2007-01-02 15:58
lzf0112
Rank: 1
等 级:新手上路
帖 子:244
专家分:0
注 册:2006-4-9
收藏
得分:0 
斑竹帮忙看一下啊。难道斑竹元旦也放假咯。。。。
2007-01-02 18:05
JavaEE5
Rank: 2
等 级:新手上路
威 望:4
帖 子:150
专家分:0
注 册:2006-12-24
收藏
得分:0 
在对应的地方加上以下两句,看输出什么!
Response.Write(sql)
Response.End()
rs.open sql,conn,1,3 //提示这一句错误啊

我喜欢JavaEE5,虽然对此不了解。
2007-01-02 19:20
lzf0112
Rank: 1
等 级:新手上路
帖 子:244
专家分:0
注 册:2006-4-9
收藏
得分:0 
输出为空啊,我有尝试过啊 ,不知道为什么啊?
2007-01-02 19:55
lzf0112
Rank: 1
等 级:新手上路
帖 子:244
专家分:0
注 册:2006-4-9
收藏
得分:0 
有没有帮忙解决一下啊~~~~~谢谢。。。
在线等啊。。。。
2007-01-02 20:56
渚薰
Rank: 6Rank: 6
等 级:贵宾
威 望:22
帖 子:1132
专家分:0
注 册:2006-8-6
收藏
得分:0 
你再进行一连串if判断的时候,都没有执行if的内部语句,导致sql变量一直为空
请仔细检查你用Request获得的几个变量的值是否符合要求
全部输出看以下

个人ajax技术专题站: " target="_blank">http://www. 我不会闲你烦,只会闲你不够烦!
2007-01-03 10:47
t56758408
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2007-1-4
收藏
得分:0 
这种问题 你最好 检查一下 你要判断的函数是否有值
在就是 对应数据库表 多检查下表单是否对应
我起初很爱出类似滴问题 都是因为粗心
多检查下是否有数值是否都对应
应该没什么大问题
2007-01-04 01:38
lzf0112
Rank: 1
等 级:新手上路
帖 子:244
专家分:0
注 册:2006-4-9
收藏
得分:0 
谢谢大家。。。。。
问题已经查出来了,可能是由于SQL语句里面有些类型不匹配啊。。。。
2007-01-04 16:18
forever759
Rank: 1
等 级:新手上路
帖 子:109
专家分:0
注 册:2006-11-29
收藏
得分:0 
那应该怎么解决呀???
同求帮忙呀!
2007-04-08 12:29
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
以下是引用forever759在2007-4-8 12:29:17的发言:
那应该怎么解决呀???
同求帮忙呀!

最简单的方法Response.write(sql)
看看sql语句是否正确。

2007-04-08 16:43
快速回复:[求助]ADODB.Recordset (0x800A0BB9)
数据加载中...
 
   



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

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