| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 609 人关注过本帖
标题:请教个问题
取消只看楼主 加入收藏
kingbyes
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-3-4
收藏
 问题点数:0 回复次数:1 
请教个问题
我做了denglu.asp,是个登陆页面,浏览没有问题,但是在用户名和密码里输入以后点登陆就会出现错误
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLSetConnectAttr 失败
代码是
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/admin.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("user"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization=""
  MM_redirectLoginSuccess="true.asp"
  MM_redirectLoginFailed="error.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_admin_STRING
  MM_rsUser.Source = "SELECT 编号, admin"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM admin WHERE 编号='" & Replace(MM_valUsername,"'","''") &"' AND admin='" & Replace(Request.Form("password"),"'","''") & "'"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  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.
<html xmlns="http://www. InstanceBegin template="/Templates/index.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>无标题文档</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="168个网页Banner/002.jpg" width="770" height="200" /></td>
  </tr>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="187"><table width="187" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="本书实例源文件及最终文件/原始文件/ch4/00.jpg" width="200" height="150" /></td>
      </tr>
      <tr>
        <td><img src="本书实例源文件及最终文件/原始文件/ch4/1.jpg" width="200" height="150" /></td>
      </tr>
      <tr>
        <td><img src="本书实例源文件及最终文件/原始文件/ch4/51.jpg" width="200" height="150" /></td>
      </tr>
      <tr>
        <td><img src="本书实例源文件及最终文件/原始文件/ch4/t]2.jpg" width="200" height="150" /></td>
      </tr>
    </table></td>
    <td width="545" valign="top"><!-- InstanceBeginEditable name="zhengwen" -->
      <form ACTION="<%=MM_LoginAction%>" id="form1" name="form1" method="POST">
        <table width="40%" border="0" align="center" cellpadding="2" cellspacing="2">
          <tr>
            <td colspan="2">登陆</td>
          </tr>
          <tr>
            <td>用户名</td>
            <td><input name="user" type="text" id="user" size="12" /></td>
          </tr>
          <tr>
            <td>密码</td>
            <td><input name="password" type="password" id="password" size="12" /></td>
          </tr>
          <tr>
            <td>?</td>
            <td><input type="submit" name="Submit" value="提交" />
            <input type="reset" name="Submit2" value="重置" /></td>
          </tr>
        </table>
      </form>
    <!-- InstanceEndEditable --></td>
    <td width="38">?</td>
  </tr>
</table>
</body><!-- InstanceEnd -->
</html>
我是新手,请高手帮忙分析下,谢谢了.
搜索更多相关主题的帖子: 密码 Microsoft request include 
2008-03-04 21:01
kingbyes
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-3-4
收藏
得分:0 
我的QQ是228091669,可以加我QQ指教
2008-03-04 21:08
快速回复:请教个问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018858 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved