主题:  数据库保存不了

82941016

职务:普通成员
等级:1
金币:0.0
发贴:42
#12005/8/2 10:28:15

图片如下:

我是一名初学者,不能保存数据它报告这句有错 MM_editCmd.Execute



{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
#22005/8/2 13:50:36
那就是 update 语法错误呗。。。

贴你的 update 语句出来看看?



82941016

职务:普通成员
等级:1
金币:0.0
发贴:42
#32005/8/3 9:12:34
代码全由DW产生的



82941016

职务:普通成员
等级:1
金币:0.0
发贴:42
#42005/8/3 9:17:41

相关文件(rar):点这儿打开有劳大侠帮我改改,快开学了,我急



{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
#52005/8/3 9:53:35
把 insert.asp 的第 111 行。。

引用:
MM_editCmd.Execute


变成。。

引用:
response.write MM_editQuery
response.end


我本地没 ASP 环境。。。

用大脑调试 DW 生成的代码又太累。。。

帮我看下生成的结果咯。。。



82941016

职务:普通成员
等级:1
金币:0.0
发贴:42
#62005/8/4 8:23:43
大侠,还是不行,它没报告错误,只是把update语名全部写出来了

编辑历史:[此帖最近一次被 82941016 编辑过(编辑时间:2005-08-04 08:41:51)]


{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
#72005/8/5 9:37:48
把 update 语句的内容贴出来咯。



82941016

职务:普通成员
等级:1
金币:0.0
发贴:42
#82005/8/5 10:31:19
它把update全部语名写在屏幕上了
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update") <> "" And CStr(Request("MM_recordId") <> "" Then

' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
response.Write MM_editQuery
    response.end
MM_editCmd.ActiveConnection.Close

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

End If
%>



{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
#92005/8/5 10:32:57
我的意思是说。。。








。。。。把你屏幕上的内容贴出来呗。。。



82941016

职务:普通成员
等级:1
金币:0.0
发贴:42
#102005/8/5 10:50:40
update lr set ID = 3,name = 'sdfblskdjfgbl',icon = '15',email = 'asdfgasd@163.com',text = '谢谢行者大侠',date = '2005-8-5 10:49:41',rtext = '',rdate = '2005-8-5 10:49:41' where ID = 3



{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
#112005/8/5 11:47:57
update语句应该是这样的。。。

引用:
update lr set ID = 3,name = 'sdfblskdjfgbl',icon = '15',email = 'asdfgasd@163.com',text = '谢谢行者大侠',date = #2005-8-5 10:49:41#,rtext = '',rdate = #2005-8-5 10:49:41# where ID = 3


但是 DW 生成的代码实在太难读了。。。。



在海水中游泳

职务:普通成员
等级:5
金币:0.0
发贴:76
#122005/8/10 13:13:10
update lr set ID = 3,name = 'sdfblskdjfgbl',icon = '15',email = 'asdfgasd@163.com',text = '谢谢行者大侠',date = #2005-8-5 10:49:41#,rtext = '',rdate = #2005-8-5 10:49:41# where ID = 3

有没有搞错!

set ID = 3, 还 where ID=3 ,你袋袋进水了?

还有ID那个字段什么东东?什么类型?能修改吗?


我有一对翅膀,不是用来飞翔,而是用来煮汤。