标题:[求助] [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '3' 附近 ...
只看楼主
流星若梦
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2005-8-14
 问题点数:0 回复次数:1 
[求助] [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '3' 附近有语
一段数据库由ACCESS 转换为SQL SERVER2000 后出现的错误! 请高手们代为解答! sql = "select * from calls where (towho='大家' and datediff(s,calltime," & Rs("out_time") & ")<0) or (towho='" & sUserName & "' and read=0 ) order by ID desc" Set rs2 = conn.Execute(sql) 运行后出错如下 Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '3' 附近有语法错误。 /stchat/check.asp,行269 如果去掉 and datediff(s,calltime," & Rs("out_time") & ")<0 即源代码剩下:也会报错! sql = "select * from calls where (towho='大家') or (towho='" & sUserName & "' and read=0 ) order by ID desc" Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]在关键字 'read' 附近有语法错误。 /stchat/check.asp,行269
搜索更多相关主题的帖子: SQL Microsoft ODBC Driver Server 
2005-08-14 05:35
yichen
Rank: 1
等 级:新手上路
帖 子:303
专家分:0
注 册:2005-3-9
得分:0 
sql = "select * from calls where (towho='大家') or (towho='" & sUserName & "' and read=0 ) order by ID desc" 这一句中where 条件 既有or 又有and, 可能是 逻辑问题。

衣带渐宽终不悔, 为伊消得人憔悴。 纸上得来终觉浅, 绝知此事要躬行。
2005-08-16 15:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-25086-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.255801 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved