insert into 语句中语法错误;各位大哥帮个忙!
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
/学习/xrsj.asp, 第 17 行
以下是代码:
<%
set conn=server.createobject( "adodb.connection ")
conn.open "driver={microsoft access driver (*.mdb)};dbq= "&server.mappath( "guestbook.mdb ")
mz=request.form( "mz ")
ly=request.form( "ly ")
qq=request.form( "qq ")
cx= "insert into yonghu(mz,ly,qq)values( ' "&mz& " ', ' "&ly& " ', "&qq& ") "
conn.execute cx
conn.close
set conn=nothing
response.write "记录添加成功! "
%>
错误的第17行对应上面那代码的第10行!!
谢谢!!紧急问题
------解决方案--------------------qq是字符型的吗?试试看
cx= "insert into yonghu(mz,ly,qq) values( ' " & mz & " ', ' " & ly & " ', ' " & qq & " ') "
------解决方案--------------------cx= "insert into yonghu(mz,ly,qq) values( ' "&mz& " ', ' "&ly& " ', "&qq& ") "
------解决方案--------------------那就要查mz,ly,qq里有没有值了
cx= "insert into yonghu(mz,ly,qq) values( ' " & mz & " ', ' " & ly & " ', ' " & qq & " ') "
response.write cx
将cx显示出来,将语句拷贝到数据库环境下执行下就知道错在哪里了。
------解决方案--------------------你ACCESS里面的字段都是什么类型啊,先看一下相应的类型对不对,
如果对,我觉得还是把你的cx先response.write一下吧,我想应该是你的传过来的值有问题
------解决方案--------------------response.write cx 显示出来是什么。贴一下.