我的表单要实现的功能是向数据库中插入记录,已经建立了记录集,服务器行为也设置了插入数据,可每次点击提交的时候总出现这个界面:
本页无法显示
试图访问的网页出现问题,无法显示。
--------------------------------------------------------------------------------
请尝试以下方法:
单击 刷新按钮或者梢候再试。
打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务
--------------------------------------------------------------------------------
技术信息(适用于支持人员)
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
/denglu2.asp, 第 115 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
页:
POST 351 bytes to /denglu2.asp
POST 数据:
%D3%C3%BB%A7%C3%FB=sunjingli&%D0%D5%C3%FB=sunjingli&%C3%DC%C2%EB=sunjingli&%C3%DC%C2%EB2=sunjingli&radiobutton=1&%C3%F1%D7%E5=%BA%BA%D7%E5&%CA%A1%B7%DD=1&%D1%A7%C0%FA=1&%B3%F6%C9%FA%C8%D5%C6%DA=123&%C . . .
时间:
2005年2月3日, 13:44:36
详细信息:
Microsoft 支持
DW中的代码如下:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/mymembers.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"
)
If (Request.QueryString <> ""
Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(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"
) = "form1"
Then
MM_editConnection = MM_mymembers_STRING
MM_editTable = "join_table"
MM_editRedirectUrl = "dengluok.asp"
MM_fieldsStr = "用户名|value|姓名|value|密码|value|radiobutton|value|民族|value|省份|value|学历|value|出生日期|value|身份证|value|联系电话|value|E-mail|value|联系地址|value|邮编|value"
MM_columnsStr = "id|',none,''|name|',none,''|password|',none,''|sex|',none,''|nationality|',none,''|province|',none,''|experience|',none,''|birthday|',none,''|number|',none,''|tel|',none,''|E-mail|',none,''|dress|',none,''|Postcode|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_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
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
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> ""
Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_mymembers_STRING
Recordset1.Source = "SELECT * FROM join_table"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>