asp 在win2000与XP中不同运行结果

luffy_dd 2008-11-27 09:33:21
原代码:
<!--#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

补充一个问题:
上述文件用XP系统做服务器的运行情况这是样
当选择 > < =都可以得到正确的结果
只有选择 LIKE时出现错误,错误内容相同
用2000系统做服务器时,
当选择 < = 时得到正确结果
当选择 > like 运行时提示错误,
麻烦各位高手帮忙,感激不尽。
...全文
65 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
luffy_dd 2008-12-03
  • 打赏
  • 举报
回复
本人的结帖率有点低,但是以上两位还肯回答,我在此非常感谢以上两位。
我测试过了,跟据2楼的意见,我作一下修怍,就成功了。
luffy_dd 2008-12-02
  • 打赏
  • 举报
回复
谢谢两位的回答,我试一下再回复你们,无论如何谢了。
草原可可 2008-11-27
  • 打赏
  • 举报
回复
是不是like 写错了 模糊查询 换种方式呢
qiubin200236 2008-11-27
  • 打赏
  • 举报
回复
.....你LIKE边上没空格

28,390

社区成员

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

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