ASP动态网站留言板里的错误!请高手帮下忙……
我网站里面的一个留言板出现的问题。我是用“自定义连接字符串”来绑定我的ACCESS数据库的!每次我在留言板写好东西提交时,就会弹出如下的错误报告。请高手帮忙下…… (或请高手们给我一个留言板的做法或者代码)
一、弹出问题信息如下:
Microsoft JET Database Engine '80040e07'
标准表达式中数据类型不匹配。
\wwwroot\laoke\liuyan.asp, line 115
二、代码如下:
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
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_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_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 ‘这就是115行
MM_editCmd.ActiveConnection.Close ’这就是116行
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim RS
Dim RS_numRows
Set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = MM_conn_STRING
RS.Source = "SELECT * FROM msg"
RS.CursorType = 0
RS.CursorLocation = 2
RS.LockType = 1
RS.Open()
RS_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 3
Repeat1__index = 0
RS_numRows = RS_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim RS_total
Dim RS_first
Dim RS_last
' set the record count
RS_total = RS.RecordCount
' set the number of rows displayed on this page
If (RS_numRows < 0) Then
RS_numRows = RS_total
Elseif (RS_numRows = 0) Then
RS_numRows = 1
End If
' set the first and last displayed record
RS_first = 1
RS_last = RS_first + RS_numRows - 1
' if we have the correct record count, check the other stats
If (RS_total <> -1) Then
If (RS_first > RS_total) Then
RS_first = RS_total
End If
If (RS_last > RS_total) Then
RS_last = RS_total
End If
If (RS_numRows > RS_total) Then
RS_numRows = RS_total
End If
End If
%>