主题:  谁来帮我看看这是怎么回事?

蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#12001/11/24 2:20:40
我用acesse建了一个数据库,里面有两个表。用ud建了向其中一个表添加新记录的页面,运行的时候总是提示下面错误,
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC Microsoft Access 驱动程序] INSERT INTO 语句的语法错误。

/shop/add2.asp, 行90


这是机器生成的源码
<%@LANGUAGE="VBSCRIPT"%>

<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) <> "") Then

MM_editConnection = MM_dbcoon_STRING
MM_editTable = "order"
MM_editRedirectUrl = "succ.asp"
MM_fieldsStr = "order_name|value|order_produce|value|order_ads|value|order_tel|value|order_post|value|order_mail|value|order_path|value|order_guest|value"
MM_columnsStr = "order_name|',none,''|order_produce|',none,''|order_ads|',none,''|order_tel|none,none,NULL|order_post|none,none,NULL|order_mail|',none,''|order_path|',none,''|order_guest|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request("MM_insert")) <> "") Then

' create the sql insert statement
MM_tablevalues = ""
MM_dbvalues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tablevalues = MM_tablevalues & ","
MM_dbvalues = MM_dbvalues & ","
End if
MM_tablevalues = MM_tablevalues & MM_columns(i)
MM_dbvalues = MM_dbvalues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tablevalues & ") values (" & MM_dbvalues & ")"

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>


表单部分省略了



jesron

职务:普通成员
等级:2
金币:1.0
发贴:393
注册:2001/1/27 0:06:31
#22001/11/24 11:09:56
你整个页面再重新做一次可能就行了。我以前也遇到过。记住,要把里面所有的asp代码全部删除。



I''MAD

职务:普通成员
等级:8
金币:11.0
发贴:9502
注册:2001/9/16 20:00:53
#32001/11/24 13:28:42
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
是这几行吧?我的也是,情况一模一样,就算全册了也没用。



蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#42001/11/24 13:44:48
我重做过 好几次了……还是没用。好像数据库只有一个表的话就行。有两个表就不行了……
难道ud就真的只能做做留言本……



I''MAD

职务:普通成员
等级:8
金币:11.0
发贴:9502
注册:2001/9/16 20:00:53
#52001/11/24 15:24:53
我现在就在做,数据库里只有一个表,也是出错。



蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#62001/11/24 15:26:33
倒?我一个表倒可以的,只是叫我把一起的表分开来建两个数据库,我觉得太浪费了……



I''MAD

职务:普通成员
等级:8
金币:11.0
发贴:9502
注册:2001/9/16 20:00:53
#72001/11/24 16:37:15
是啊,头痛死了,我现在正在用UE手写。
兄弟,能不能用你的UD帮我做几个页面,很简单,就是一个注册的页面。数据库里只要一个表,(id,name,password),然后只要数据能插进数据库里就行了,连接方法就用OLE DB的吧,发到我邮箱里,不知楼上的兄弟可否?



蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#82001/11/24 20:05:22
你什么时候要阿?



jesron

职务:普通成员
等级:2
金币:1.0
发贴:393
注册:2001/1/27 0:06:31
#92001/11/24 21:48:01
装升级版吧.升到4.01可能就会解决啦.我以前做搜索引擎时也是会出错,后来升级后不用改任何东西都可以用呀...........



蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#102001/11/24 22:41:22
我的就是4。01而且没汉化过!
ud就是不稳定!



I''MAD

职务:普通成员
等级:8
金币:11.0
发贴:9502
注册:2001/9/16 20:00:53
#112001/11/26 13:18:17
越快越好啊,我想试一下是不是我的机子有问题,昨天不能上网,不好意思啊,发我邮箱吧。



蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#122001/11/26 18:45:25
呵呵,从昨天开始我也连一个表都不能插入了,我换到win2000下面看看



超级菜鸟

职务:普通成员
等级:1
金币:0.0
发贴:58
注册:2000/12/23 10:33:51
#132001/11/26 19:24:42
这种毛病多了,有时候只要把代码全删除了,再重新做就好了,有时候重新启动计算机也能解决,不知道是UD的毛病还是系统的毛病,而且我的UD一转换到五笔输入汉字就出错。我用的是WIN98第二版+UD4.01+王码五笔4.5。真是让人伤心。毛病多多。



蓝岭飞鸟

职务:普通成员
等级:2
金币:1.0
发贴:395
注册:2001/10/18 12:37:14
#142001/11/26 19:52:45
我绝到~这次怎么都不行了。换到2000下也没用……阿~我要和UD说拜拜了



I''MAD

职务:普通成员
等级:8
金币:11.0
发贴:9502
注册:2001/9/16 20:00:53
#152001/11/27 8:44:27
啊也,我的早就是WIN2000服务器版了,绝对没问题,看来我也要跟UD说88了,昨天就是用UE写了一天,连数据库都没连通,气死了。哪位兄弟要是用UD写了插了记录集的页面,不妨拿出来给我们试一试,看看我们是机子的原因还是软件的原因啊!