登录界面问题 请各位大神帮我看看啊
asp吧
全部回复
仅看楼主
level 1
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include virtual="/myasp/Connections/conn1.asp" -->
<%
* *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("u"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
MM_fldUserAuthorization = ""
MM_redirectLoginSuccess = "/myasp/学习/登陆成功.asp"
MM_redirectLoginFailed = "/myasp/学习/登陆失败.asp"
MM_loginSQL = "SELECT name, [key]"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM aa.[user] WHERE name = ? AND [key] = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_conn1_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) * adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 255, Request.Form("k")) * adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
* username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
2014年08月18日 05点08分 1
level 1
错误信息:
ADODB.Command 错误 *800a0bb9*
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/myasp/学习/后台登陆.asp,行 24
2014年08月18日 05点08分 2
level 12
这个错误写的很清楚了
参数 数据类型不对
是不是 字符的用了数字,或者数字用了字符 之类的!
还有空值问题!!不允许为空的字段,填了空值等~~~
2014年08月18日 14点08分 3
1