错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失) 在查询表达式 'ispass=1 and isdel=0 and islock=0 and isopen=1 and dept_id=() and dept_num=()' 中.错误代码处dim deptids,deptnumsdeptids =session("dept_i

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 17:38:53
错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失) 在查询表达式 'ispass=1 and isdel=0 and islock=0 and isopen=1 and dept_id=() and dept_num=()' 中.错误代码处dim deptids,deptnumsdeptids =session(
xU_oK*}֬>@>x}0n*ŝFiKXOV @7J[lٙ]<&4h$%9wAX;tm騿5e mt-e)ѤzWQ1f/bci5"leR>&m숈ַۦٴ7/B)BqRe12Ǫg%qGU}8 02{(ohc^V]E&LwGI Q45"𠉴>clt\_cl(Sx1;?Al Q`=:㔁=1PDHɚ82z.JeRsׯ 2C=%s9յif !0 0B+aHUz_wF5Q_Z" Rd,qLGq4N{IɇTUKqEZM4F5茮 <.bߟ3qS@N'L '`nr6C1{F-~-/1Ow 꼇 b/;la-}ϒ](;]~ DkW;`70B>BBX@ܼiu=5/ƪۖݚ[ H`MElG"xC ߉0b|XOձ>`CT]J e i=[7o /Iޝ%^Iڇ^muHvr;^+k0bD]km; V ףY`!"~\kδ]y3Zlq1 tvvV2"( ~2{U>`~NS@{`?3༸N]0? )hIqwKO38IOZ|Lhb FDwo 7

错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失) 在查询表达式 'ispass=1 and isdel=0 and islock=0 and isopen=1 and dept_id=() and dept_num=()' 中.错误代码处dim deptids,deptnumsdeptids =session("dept_i
错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'ispass=1 and isdel=0 and islock=0 and isopen=1 and dept_id=() and dept_num=()' 中.
错误代码处
dim deptids,deptnums
deptids =session("dept_id")
deptnums=session("dept_num")
set rs=server.Createobject ("adodb.recordset")
if channelID"" then
sql="select * from news where ("&sql&") and dept_id=("&deptids&") and dept_num=("&deptnums&") and ispass=1 and isdel=0 and islock=0 and isopen=1 order by istop desc,newsid desc"
else
sql="select * from news where ispass=1 and isdel=0 and islock=0 and isopen=1 and dept_id=("&deptids&") and dept_num=("&deptnums&") order by istop desc,newsid desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write ""
改成:
sql="select * from news where ispass=1 and isopen=1 and and isdel=0 and islock=0 dept_id in ("&deptids&") and dept_num in ("&deptnums&") order by istop desc,newsid desc"
语法错误 (操作符丢失) 在查询表达式 'ispass=1 and isopen=1 and and isdel=0 and islock=0 dept_id in (2) and dept_num in (1)' 中.
难道语句太长就不行么……

错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失) 在查询表达式 'ispass=1 and isdel=0 and islock=0 and isopen=1 and dept_id=() and dept_num=()' 中.错误代码处dim deptids,deptnumsdeptids =session("dept_i
1 字符串的查询语句不是打括号,而是打单引号.
应该改成:"dept_id='"& deptids & "'"
如果参数deptids有多个,需要用逗号连接的形式(如:'A','B','C' 注意要单引号,如果不是字符串格式,就直接是A,B,C就可以了),SQL语句需改成"dept_id in ("& deptids & ")"
2 sql="select * from news where ("&sql&") and dept_id=("&deptids&") and dept_num=("&deptnums&") and ispass=1 and isdel=0 and islock=0 and isopen=1 order by istop desc,newsid desc"
这一句中的 ("& sql &")是不是搞错了,和现在这个字符串名字(sql)是一样的.
-----------------------------------------
看样子dept_id 和 dept_num是数字型.
把dept_id=(xxx) 和 dept_num=(xxx)改成
dept_id in (),dept_num in ()
并且需要判断deptids 和 deptnums是否为空,如果为空,就不要加到判断条件里.
另外deptids 和 deptnums 是不是指有多个?如果是多个,需要用逗号分开.