+ -
当前位置:首页 → 问答吧 → [Microsoft][ODBC Microsoft Access Driver] 语法错误 (逗号) 在查询表达式 'id = 83, 79' 中。

[Microsoft][ODBC Microsoft Access Driver] 语法错误 (逗号) 在查询表达式 'id = 83, 79' 中。

时间:2011-11-21

来源:互联网

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (逗号) 在查询表达式 'id = 83, 79' 中。
/web/admin/gedanxiugai.asp, 第 105 行

修改页面代码
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_shujuku_STRING;
Recordset1.Source = "SELECT * FROM 详细 WHERE id = "+ Recordset1__MMColParam.replace(/'/g, "''") + "";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>


在动态表格中第一次能进修改页,第二次就出现错误,,,

作者: scanfme   发布时间: 2011-11-21

VB code

Recordset1.Source = "SELECT * FROM 详细 WHERE id in( "+ Recordset1__MMColParam.replace(/'/g, "''") + ")";


作者: yajun_snow   发布时间: 2011-11-21

Recordset1.Source = "SELECT * FROM 详细 WHERE id = "& Recordset1__MMColParam.replace(//g,"''")

Recordset1.Source = "SELECT * FROM 详细 WHERE id in ('"&id&"')"

作者: hefeng_aspnet   发布时间: 2011-11-21

使用 Recordset1.Source = "SELECT * FROM 详细 WHERE id = "& Recordset1__MMColParam.replace(//g,"''")
后出现
Microsoft JScript 编译错误 (0x800A03EE)
缺少 ')'
/web/admin/gedanxiugai.asp, line 102, column 25
Recordset1.CursorType = 0;
------------------------^

作者: scanfme   发布时间: 2011-11-21

VBScript code

Recordset1.Source = "SELECT * FROM 详细 WHERE id in ("&id&")"

作者: ChengFei_Net   发布时间: 2011-11-21