下面是一个有关查询的语句,可是每是预览是都会提示:
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>"
%>
<%
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> "
else
response.write "上一页 "
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> "
else
response.write "下一页"
end if
%>
<%
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>
[求助]ADODB.Recordset (0x800A0BB9)