ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/paper_serch/jscj.asp,行 47
下面是我的查询分页显示代码,文件名是jscj.asp
<body>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/js_title.png" width="780" height="100"></td>
</tr>
<tr>
<td height="13"> </td>
</tr>
</table>
<%
dim strselect, strinput,strsql
strselect=Request.form("txtPrimary") '从上一页取得参数
strinput=Request.form("txtinput") '从上一页取得参数
select case strselect
case "论文题名"
strsql="select * from xwlwtj where (Chntitle='"&strinput&"')"
case "论文作者"
strsql="select * from xwlwtj where (Name='"&strinput&"')"
case "导师"
strsql="select * from xwlwtj where (Teachername1='"&strinput&"')"
case "学科专业"
strsql="select* from xwlwtj where (Major='"&strinput&"')"
case"关键词"
strsql="select * from xwlwtj where (Keyword like '%"&strinput&"%')"
case"中文摘要"
strsql="select * from xwlwtj where (AbstructCH like '%"&strinput&"%')"
end select
set conn=server.CreateObject("ADODB.Connection")
conn.open"Driver={SQL Server};Server=USER;Database=paperdate;Uid=sa;Pwd=123"
set rs=server.createobject("ADODB.recordset")
'rs.CursorType ="adOpenStatic"
'rs.CursorLocation ="adUseClient"
rs.open strsql,conn,"3","1" '出错行
PgSz="1"
rs.PageSize = Cint(PgSz)
Total=INT(RS.recordcount / PgSz * -"1")*-"1" '计算可显示页面的总数
%>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="post" action="">
<tr>
<td width="83" height="25"> </td>
<td width="619" height="25"><font size="2"><strong>查询结果:</strong></font><font size="2">检索命中记录数为<%=rs.RecordCount%>条,共<%=rs.pageCount%>页</font> </td>
<td width="78" height="25"> </td>
</tr>
<tr>
<td width="83" height="25"> </td>
<td height="25"><font size="2"><strong>当前检索表达式为</strong>:
<%response.write""&strselect&"="&strinput&""%></font></td>
<td height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"> <select name="txtPrimary" >
<option value="论文题名">论文题名</option>
<option value="论文作者">论文作者</option>
<option value="导师">导师</option>
<option value="学科专业">学科专业</option>
<option value="关键词">关键词</option>
<option value="中文摘要">中文摘要</option>
</select>
<input type="text" name="textfield" size="30">
<input type="submit" name="Submit" value="二次检索"> </td>
<td height="25"> </td>
</tr>
<tr>
<td> </td>
<td><%If RS.RecordCount="0" then
response.write "<font size=2>对不起,数据库中没有相关信息!</font>"
else
PageNo=int(Request("pageno"))
if PageNo="" Then
PageNo ="1"
else
PageNo=PageNo+"1"
PageNo=PageNo-"1"
end if
ScrollAction =Request("ScrollAction")
if ScrollAction ="上一页" Then
PageNo=PageNo-"1"
end if
if ScrollAction ="下一页" Then
PageNo=PageNo+"1"
end if
if ScrollAction ="首页" Then
PageNo="1"
end if
if ScrollAction ="尾页" Then
pageNO=""&Total&""
end if
if PageNo<"1" Then
PageNo ="1"
end if
'n="1"
RS.AbsolutePage=PageNo
%> </td>
<td> </td>
</tr>
<%Do while not(RS is nothing)
RowCount=RS.PageSize
Do While Not RS.EOF and rowcount>"0"
'If n=1 then
%>
<tr>
<td></td>
<td><hr color="#E7E7CD"></td>
<td></td>
</tr>
<tr>
<td></td>
<td height="30"><span style="font-size:9pt"> <%=RS("Chntitle")%>(全文); <%=rs("Name")%>[<%=rs("Xuewei")%>]; <%=rs("Dept")%></span></td>
</tr>
</form>
<%
RowCount=RowCount-"1"
RS.MoveNext
Loop
set RS=RS.NextRecordSet
Loop
Conn.Close
set rs =nothing
set Conn=nothing
%>
<tr>
<td></td>
<td><hr color="#E7E7CD"></td>
<td></td>
</tr>
</table>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<form name=form2 method="post" action="jscj.asp">
<tr>
<td width="88" height="33" rowspan="4"> </td>
<td width="626" height="33"> <INPUT TYPE="HIDDEN" NAME="pageno" VALUE="PageNo">
<%
if PageNo>"1" Then
response.write"<INPUT TYPE=SUBMIT NAME='ScrollAction VALUE='上一页'>"
end if
if RowCount="0" and PageNo<>Total then
response.write"<INPUT TYPE=SUBMIT NAME='ScrollAction' VALUE='下一页'>"
end if
if pageNo<>"1" and pageNo<>"0"then
response.write"<INPUT TYPE=SUBMIT NAME='ScrollAction' VALUE='首页'>"
end if
if pageNo<>Total and Total>"2" then
response.write"<INPUT TYPE=SUBMIT NAME='ScrollAction' VALUE='尾页'>"
response.write "</FORM>"
end if
End if
%></td>
<td width="66" rowspan="4"> </td>
</tr>
</table>
</body>