错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失)
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/18 21:05:57
错误类型:
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,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)' 中.
难道语句太长就不行么……
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 是不是指有多个?如果是多个,需要用逗号分开.
应该改成:"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 是不是指有多个?如果是多个,需要用逗号分开.
错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失)
出现错误!Can not connect to database!
哪些操作可以关闭microsoft word文档
熟练操作Microsoft Office用英语怎么说?
"jet
丢失错误 作文怎么写?
数据窗口错误Database transaction information not available. Call S
安装出现 "Oracle Database Configuration Assistant" 失败的错误
ENGINE
engine.
microsoft text-to-speech engine是什么,有什么用,怎么用,可以删除吗
错误类型: