ASP编程问题,我不知道哪出错了

来源:百度知道 编辑:UC知道 时间:2024/05/26 19:23:13
<%
' *** 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 <> "")

晕哦 你肯定是用DW做ASP的吧? 这些代码是DW里自动生成的吧?

应该是你的update语句的语法错误,按照下面的方法测试下输出结果:
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
response.write MM_editQuery '把上面的注释掉然后加这2句,看看输出了什么东西
response.end
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If