想写个注册页,出现了这个错误。数据库权限改好了。
错误类型:
Microsoft JET Database Engine (0x80040E10)
参数 ?_4 没有默认值。
/member.asp, 第 55 行
第55行:MM_editCmd.Execute
求解。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/member.asp" -->
<%
Dim MM_editAction
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
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' *** Redirect if username exists
MM_flag = "MM_insert"
If (CStr(Request(MM_flag)) <> "") Then
Dim MM_rsKey
Dim MM_rsKey_cmd
MM_dupKeyRedirect = "successerror,asp"
MM_dupKeyUsernameValue = CStr(Request.Form("member_id"))
Set MM_rsKey_cmd = Server.CreateObject ("ADODB.Command")
MM_rsKey_cmd.ActiveConnection = MM_member_STRING
MM_rsKey_cmd.CommandText = "SELECT member_id FROM member WHERE member_id = ?"
MM_rsKey_cmd.Prepared = true
MM_rsKey_cmd.Parameters.Append MM_rsKey_cmd.CreateParameter("param1", 200, 1, 50, MM_dupKeyUsernameValue) ' adVarChar
Set MM_rsKey = MM_rsKey_cmd.Execute
If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then
' the username was found - can not add the requested username
MM_qsChar = "?"
If (InStr(1, MM_dupKeyRedirect, "?") >= 1) Then MM_qsChar = "&"
MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue
Response.Redirect(MM_dupKeyRedirect)
End If
MM_rsKey.Close
End If
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_member_STRING
MM_editCmd.CommandText = "INSERT INTO member (member_id, member_pw, member_name, member_sex, member_email, member_qm) VALUES (?, ?, ?, ?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("member_id")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("member_pw")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, Request.Form("member_name")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("member_sex")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 50, Request.Form("member_email")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 50, Request.Form("member_qm")) ' adVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "membersuccess.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Dim member
Dim member_cmd
Dim member_numRows
Set member_cmd = Server.CreateObject ("ADODB.Command")
member_cmd.ActiveConnection = MM_member_STRING
member_cmd.CommandText = "SELECT * FROM member"
member_cmd.Prepared = true
Set member = member_cmd.Execute
member_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-color: #999999;
}
-->
</style></head>
<body>
<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
<p>注册_必填</p>
<p>帐号:
<input name="member_id" type="text" id="member_id" size="20" />
仅限英语和数字</p>
<p>密码:
<input name="member_pw" type="text" id="member_pw" size="20" />
(不少于6位)</p>
<p>注册_选填</p>
<p>昵称:
<input name="member_name" type="text" id="member_name" size="20" />
</p>
<p>性别:男
<input type="radio" name="member_sex" id="radio" value="男" />
女
<input type="radio" name="member_sex" id="radio2" value="女" />
</p>
<p>E-mail:
<input name="member_email" type="text" id="member_email" size="20" />
</p>
<p>QQ/MSN:
<input name="member_qm" type="text" id="member_qm" size="20" />
</p>
<p>
<input type="submit" name="button" id="button" value="注册" />
<input name="button2" type="reset" id="button2" value="重置" />
</p>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
</body>
</html>
<%
member.Close()
Set member = Nothing
%>