错在哪里了?ACCESS 中 INSERIT INTO语法问题
代码如下:
<%
set conn=server.createobject( "adodb.connection ")
conn.open "driver={microsoft access driver (*.mdb)};dbq= "&server.mappath( "gustb.mdb ")
id=request.form( "aid ")
ccase=request.form( "acase ")
starttime=request.form( "astime ")
overtime=request.form( "aotime ")
reason=request.form( "areason ")
worker= request.form( "aworker ")
exec= "insert into beian([id],[ccase],[strattime],[overtime],[reason],[worker])values( "+aid+ ", ' "+acase+ " ', ' "+astime+ " ', ' "+aotime+ " ', ' "+areason+ " ', ' "+aworker+ " ') "
conn.execute exec
rs.open exec,conn,1,3
conn.close
set conn=nothing
response.write "记录添加成功! "
%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
/tj.asp, 第 11 行
------解决方案--------------------如果strattime,overtime 是日期类型 要用#
# "&astime& "#,# "&aotime& "#