Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14' 
[MySQL][ODBC 5.1 Driver][mysqld-5.1.50-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 /admin/add_good_do.asp,行 20 代码:
<html>
<head>
<title>学生信息</title>
</head>
<body>
 <!--#include file="../conn.asp"-->
<%
tmpid =request.Form("ID")
tmpname =request.Form("goodname")
tmpprice =request.Form("price")
tmpsort =request.Form("sort")
tmpbrand =request.Form("brand")
tmpnum =request.Form("num")
tmpin= request.Form("in")dim rs, strrs
set rs = server.CreateObject("adodb.recordset")
strrs = "insert into good(ID,name,price,sort,brand,num,pricein) values('"&tmpid&"','"&tmpname&"',"&tmpprice&",'"&tmpsort&"','"&tmpbrand&"',"&tmpnum&","&tmpin&")"rs.open strrs, conn//此处为20行
response.write "<script language=JavaScript>"  & "alert('添加成功!');" &"history.back()"  & "</script>" %>
</body>
</html>本人乃菜鸟,请高手指教

解决方案 »

  1.   

    SQL语法问题。 加入下面两行,检查你的SQL语句是什么。strrs = "insert into good(ID,name,price,sort,brand,num,pricein) values('"&tmpid&"','"&tmpname&"',"&tmpprice&",'"&tmpsort&"','"&tmpbrand&"',"&tmpnum&","&tmpin&")"response.write strrs 
    response.end
    rs.open strrs, conn//此处为20行
      

  2.   

    这个问题第二天再运行的时候就自动好了。但现在又出现了相似的问题。dim rs,sql
    set rs = server.CreateObject("adodb.recordset")
    sql="update good set name='"&tmpname&"',price="&tmpprice&",sort='"&tmpsort&"',brand='"&tmpbrand&"',num="&tmpnum&",pricein="&tmpin& "where ID='"&tmpid&"'"conn.execute sql[MySQL][ODBC 5.1 Driver][mysqld-5.1.50-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sort='',brand='',num=,pricein=where ID=''' at line 1数据库应该是连接上,它说语法有问题,但是我把语句放到Mysql里是可以运行的。但在网页中却出项这样的问题,这到底是怎么回事!
      

  3.   

    我用2楼的方式试了今天的问题,SQL语言是这样的
    update good set name='',price=,sort='',brand='',num=,pricein= where ID=''
    这个语言有问题吗?
      

  4.   

    update good set name='',price=,sort='',brand='',num=,pricein= where ID=''很明显,这个SQL语句语法不对。num=0,pricein=0 where ID=123'' 这样才行。