Acess数据库,ORDER BY 子句语法错误,奇怪了!
源码:
Sql = "select * from LF188_Card where Time = #"&JDate&"# "
sql = sql & " order by id" 按id进行排序
sql = sql & " order by Time" 按时间进行排序 ——注:去掉这行后,程序则可无错执行,只要加上这行就提示如下错误!
Set rs = Server.CreateObject("Adodb.Recordset")
rs.Open sql, Conn, 1, 1
错误信息:
Microsoft JET Database Engine 错误 '80040e14'
ORDER BY 子句语法错误。
[解决办法]
sql = sql & " order by id"
sql = sql & " order by Time"
估计是ID与TIME 2者起冲突了。
[解决办法]
Sql = "select * from LF188_Card where Time = #"&JDate&"# "
sql = sql & " order by Time, id"