[求助] [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