首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

语法异常 (操作符丢失) 在查询表达式 'id=' 中!

2012-03-14 
语法错误 (操作符丢失) 在查询表达式 id 中!!??代码如下:%idrequest.Form( id )kfsrequest.Form(

语法错误 (操作符丢失) 在查询表达式 'id=' 中!!??
代码如下:
<%
id=request.Form( "id ")
kfs=request.Form( "kfs ")
lxr=request.Form( "lxr ")
tel=request.Form( "tel ")
ccase=request.Form( "ccase ")
reason=request.Form( "reason ")
starttime=request.Form( "starttime ")
overtime=request.Form( "overtime ")
worker=request.Form( "worker ")
spr=request.Form( "spr ")
set   conn=server.createobject( "adodb.connection ")
conn.open   "driver={microsoft   access   driver   (*.mdb)};dbq= "&server.mappath( "gustb.mdb ")
exec= "select   *   from   beian   where   id= "+id
set   rs=server.createobject( "adodb.recordset ")
rs.open   exec,conn,1,3
%>

错误类型:
错误类型:
Microsoft   OLE   DB   Provider   for   ODBC   Drivers   (0x80040E14)
[Microsoft][ODBC   Microsoft   Access   Driver]   语法错误   (操作符丢失)   在查询表达式   'id= '   中。
/asp   备分/baxg.asp,   第   16   行

ID字段的类型是自动编号,为什么这么写不对呢?


[解决办法]
试试
exec= "select * from beian where id = "&id
或者
exec= "select * from beian where i= "&id& " "

热点排行