zzy099 发表于 2009-7-12 21:04

【求助】请ASP 高手帮看看,谢谢!

用Dreamweaver cs3 按网上教程做的ASP登陆页面。
可以显示登陆页面,但输入用户名和密码 登陆不了,出错如下:

ADODB.Command 错误 '800a0bb9' 参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。 /lccz/admin/login.asp,行 24


网上找了很久都不到怎解决方法,只好求教万能的专门网了,请ASP高手帮看看,怎改了?谢谢

我是用:windows 2003 sp2+ sql 2005 + Dreamweaver cs3来学习的。
数据库名为 web   
网站虚拟目录为 lccz

源码:
<%
' *** 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 = "admin.asp"
MM_redirectLoginFailed = "erro.asp"

MM_loginSQL = "SELECT adminsuer, adminpass"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM dbo.wzadmin WHERE adminsuer = ? AND adminpass = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_web_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("p")) ' 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
%>
<!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" c />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
用户名:
<label>
<input type="text" name="u" id="u" />
</label>
密码:
<label>
<input type="password" name="p" id="p" />
</label>
<input type="submit" name="button" id="button" value="登陆" />
</form>
</body>
</html>


   




shengmu 发表于 2009-7-12 21:59

asp所在分区是不是NTFS格式?
如果是的话,那是文件权限不够 everyone 添加修改(或者写入)权限

zzy099 发表于 2009-7-12 22:09

是NTFS格式
文件夹和文件都是全权控制了的





sicoolqs 发表于 2009-7-15 17:15

MM_web_STRING 这个变量就没见有定义嘛
ActiveConnection应该是要赋一个已经 open的ADODB.Connection COM组件连接对象
页: [1]
查看完整版本: 【求助】请ASP 高手帮看看,谢谢!