主题:  菜鸟也学DW做ASP。(修改资料篇)更新网页出错!!急求版主

lnb30

职务:普通成员
等级:1
金币:0.0
发贴:3
#12004/7/6 14:31:25
我做了一个更新页,数据库表中有“用户”、“密码”、"RI_qa......RI_qze"33个字段,
定义了一个“MM_Username”阶段变量,按本站的教程制作了更新页,但在本地测试
时却显示:
Microsoft JET Database Engine (0x80040E14)
UPDATE 语句的语法错误。
/hh/fc/TMP3q3eabgcf.asp, 第 111 行
该行是:MM_editCmd.Execute
请帮忙解决!!

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
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

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

End If
%>



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#22004/7/6 15:29:42
和这个差不多
www.5d.cn/bbs/NewsDetail.asp?GroupName=Dreamweaver+Designer&dp=10&lp=1&id=1187035


先输出sql,然后再检查错误



lnb30

职务:普通成员
等级:1
金币:0.0
发贴:3
#32004/7/6 17:17:17
SQL语句为:
update 报休表 set password = 'yp01',RI_qa = '上班',RI_qb = '上班',RI_qc = '上班',RI_qd = '上

班',RI_qe = '上班',RI_qf = '上班',RI_qg = '上班',RI_qh = '上班',RI_qi = '上班',RI_qj = '上

班',RI_qk = '上班',RI_ql = '上班',RI_qm = '上班',RI_qn = '上班',RI_qo = '上班',RI_qp = '上

班',RI_qq = '上班',RI_qr = '上班',RI_qs = '上班',RI_qt = '上班',RI_qu = '上班',RI_qv = '上

班',RI_qw = '上班',RI_qx = '上班',RI_qy = '上班',RI_qz = '上班',RI_qza = '上班',RI_qzb = '上

班',RI_qzc = '上班',RI_qzd = '上班',RI_qze = '上班' where 编号 = 1

是哪里出了问题?是在“where”吗?