ADODB.Recordset 错误 '800a0bb9'

luffy_dd 2008-11-26 11:51:34
原代码:
<!--#include file="conn.asp"-->
<% response.Buffer=false
dim strSQL,Rs
set Rs=server.CreateObject("ADODB.Recordset")
strSQL="select * from student"
Rs.Locktype=3
Set Rs=conn.Execute(strSQL)
%>
<form action="<%=request.ServerVariables("SCRIPT_NAME") %>">
筛选<select name="fld">
<%
for each fd in Rs.fields
response.write("<option value='"&fd.name&"'>"&fd.name&"</option>")
next
%>
</select>
<select name="opt">
<option value=">"> > </option>
<option value="<"> < </option>
<option value="="> = </option>
<option value="Like">Like</option>
</select>
<input type="text" name="value" size="3">
<input type="submit" name="filter" value="筛选" />
<input type="submit" name="back" value="取消" />
</form>
<%
if request.QueryString("filter")<>"" then
'生成筛选条件
str=request.QueryString("fld")&request.QueryString("opt")&request.QueryString("value")
Rs.filter=str
'显示筛选后的结果
call writeAllRecord()
elseif request.QueryString("back")<>"" then
'取消筛选
Rs.Filter=AdFilterNone
call WriteAllRecord()
else
call WriteAllRecord()
end if

function WriteAllRecord()
'该函数用于显示当前记录集中的全部记录
if Rs.Bof and Rs.eof then
response.write "记录集为空,没有可用的查询结果"
else
response.Write("<table border='1'>")
do while not Rs.EOF
response.Write("<tr>")
for each fd in Rs.fields
response.Write("<td>"&fd.value&"</td>")
next
response.Write("</tr>")
Rs.MoveNext
Loop
response.Write("</table>")
end if
end function
%>
运行结果:可以到如下地址去,125.90.89.195/33.asp
当选择 < = 运行时可以得到正确的结果
当选择 > like 运行时提示错误,(名字如标题)
说是错误行:Rs.filter=str
会不会是转义字符的错误?如何改呢?
麻烦高手指点下。
...全文
491 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
layers2323 2008-11-26
  • 打赏
  • 举报
回复
结帖率:12.50%
........
luffy_dd 2008-11-26
  • 打赏
  • 举报
回复
补充一个问题:
上述文件用XP系统做服务器的运行情况这是样
当选择 > < =都可以得到正确的结果
只有选择 LIKE时出现错误,错误内容相同
用2000系统做服务器时,
当选择 < = 时得到正确结果
当选择 > like 运行时提示错误,
麻烦各位高手帮忙,感激不尽。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧