asp 在win2000与XP中不同运行结果
原代码:
<!--#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 运行时提示错误,
麻烦各位高手帮忙,感激不尽。