[在线等待]在模糊查询中怎么报缺少表达式~~~~~

msq847 2006-08-02 10:43:07
<% Set RS = Server.CreateObject("ADODB.RecordSet")
StrFind=replace(request.form("StrFind"),"'","''")
if StrFind="" then StrFind=request("StrFind")
if strFind<>"" Then
SqlPjlb="select count(*) cnt from t_phone_log where date like '%" & strFind & "%' or tellerno like '%" & strFind & "%' or trancode like '%" & strFind & "%' or tranname like '%" & strFind & "%' or note like '%" & strFind & "%'"
else
SqlPjlb="select count(*) cnt from t_phone_log "
end if
if strFind<>"" Then
SqlPjlb="select * from t_phone_log where date like '%"&strFind&"%' or tellerno like '%"&_
strFind&"%' or trancode like '%"&strFind&"%' or tranname like '%"&strFind&_
"%' or note like '%"&strFind&"%'"
else
SqlPjlb="select * from t_phone_log "
end if
RS.CursorLocation = 3
RS.open SqlPjlb,objConn,3
RecordCount = RS.RecordCount
%>

我也查询了数据库没错
这段有什么错误呢?
...全文
103 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
msq847 2006-08-02
  • 打赏
  • 举报
回复
积分太少了
大家见笑了
RS.open SqlPjlb,objConn,3
说这项缺少表达式
??????
langya001 2006-08-02
  • 打赏
  • 举报
回复
楼主的本意是想把'号过滤掉吧。呵。不过
StrFind=replace(request.form("StrFind"),"'","''")

if StrFind="" then StrFind=request("StrFind")
倒是冲突了。我想只有写成
strFind=Replace(Request.Form("strFind"),"'","")
If Not Empty(strFind) Then

Else

End If
这么写吧
moodboy1982 2006-08-02
  • 打赏
  • 举报
回复
楼主你这人也真逗呀。
1、你开5分也来问问题,哈哈。
2、StrFind=replace(request.form("StrFind"),"'","''")这句话好有意思呀。你把一个
单引号换成两个单引号有什么用?不出错了?
3、if strFind<>"" Then干嘛用两个这样的语句?不会合并??

28,390

社区成员

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

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