关于这种BOF 或 EOF 中有一个是“真”的问题怎么解决啊

wangh723 2006-12-04 11:07:52
view.asp的代码
<%
pr_class=request.querystring("pr_class")
set rs=server.createobject("adodb.recordset")
sql="select * from Shop_Product where pr_class = '" & pr_class & "' "
rs.open sql,conn,1,3

if rs.eof and rs.bof then
response.Write "没有分类"
end if
if not rs.eof then
%>
中间是分页代码以及要分页的内容
<%
rs.movenext
next
%>
分页的连接
<%
rs.close
set rs=nothing
end if
%>
<%end if%>

现在问题是如果SQL语句查询的是中文字段,上个页面传中文字段用的server.URLEncode(rs("pr_class"))然后这边view.asp也能显示出来,就是点下一页的时候出现关于这种 “BOF 或 EOF 中有一个是“真”……”
但是我如果传数字过来分页就能正常使用.

希望各位朋友能帮忙解决下 谢谢了~~
...全文
205 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangh723 2006-12-04
  • 打赏
  • 举报
回复
sql="select * from Shop_Product where pr_class = '" & pr_class & "' "
我加了啊
Atai-Lu 2006-12-04
  • 打赏
  • 举报
回复
搜索的时候文本类型的要加''数字类型的不用
wangh723 2006-12-04
  • 打赏
  • 举报
回复
不是那个问题,我的意思是如果传中文过来就不能分页,传数字就可以正常分页
xyliulisa 2006-12-04
  • 打赏
  • 举报
回复
if rs.eof and rs.bof then
response.Write "没有分类"
end if
if not rs.eof then

这里是不是有点重复的啊?我觉得。。。

是不是可以改为
if rs.eof and rs.bof then
response.Write "没有分类"
else
pzhuyy 2006-12-04
  • 打赏
  • 举报
回复
传中文不能分页,传数字就可以,你先过滤一下传进来的值吧,要不被注入了还不知道怎么回事...

28,391

社区成员

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

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