标题:asp+access插入问题
只看楼主
hqhb
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-7-29
结帖率:0
已结贴  问题点数:20 回复次数:1 
asp+access插入问题
我是用dw asp+access制作动态页的,在插入记录的时候就提示:

Microsoft JET Database Engine 错误 '80040e14'

INSERT INTO 语句的语法错误。

/zhuce1.asp,行 37

第37 行是:
MM_editCmd.Execute

我也制作了另一个页面,也是插入记录的,步骤也是用 服务器行为插入记录的,但可以正常插入,
可是在这个网页就提示上述错误,是为什么啊,急于求高手解决,
dw生成的部分代码如下:(本人只懂操作,不懂代码)
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
  If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject (")
    MM_editCmd.ActiveConnection = MM_cnn2_STRING
    MM_ = "INSERT INTO zczl (username, password, qx, zswt, da, sex, szdw, addr, yb, tel, cz, yx, wz) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("username")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("password")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, Request.Form("qx")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("zswt")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 50, Request.Form("da")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 50, Request.Form("sex")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1, 50, Request.Form("szdw")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202, 1, 50, Request.Form("addr")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 202, 1, 50, Request.Form("yb")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param10", 202, 1, 50, Request.Form("tel")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param11", 202, 1, 50, Request.Form("cz")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param12", 202, 1, 50, Request.Form("yx")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param13", 202, 1, 50, Request.Form("wz")) ' adVarWChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    ' append the query string to the redirect URL
搜索更多相关主题的帖子: Microsoft Request 服务器 record false 
2016-07-29 17:04
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:396
帖 子:11713
专家分:43267
注 册:2006-5-13
得分:20 
会不会是插入的数据与字段的类型不一致?

活到老,学到老! http://www. E-mail:hu-jj@
2016-08-01 07:53
lukebc
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
得分:0 
有这么麻烦吗,用 Add()方法插入不就行了
2016-09-06 11:07
lukebc
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
得分:0 
有这么麻烦吗,用 Add()方法插入不就行了
2016-09-06 11:07
lukebc
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
得分:0 
有这么麻烦吗,用 Add()方法插入不就行了
2016-09-06 11:08
lukebc
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
得分:0 
用 Add()方法插入不就行了
2016-09-06 11:08



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-467362-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.355646 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved