望高手解答,关于用DW和ACCESS做的网页用户验证失败问题~!
"MicrosoftVBScript编译器错误错误'800a03f6'缺少'End'/iisHelp/common/500-100.asp,行242MicrosoftOL...
"Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
[Microsoft][ODBC 驱动程序 管理器] 未发现数据源名称并且未指定默认驱动程序
/login.asp,行14 "
当我输入帐号和密码登陆时出现以上问题,数据库一定是连接成功,因为之前已经可以添加,删除信息.但Connections文件夹里没有conn文件,这应该不关事吧.代码如下:
<!--#include file="Connections/c2.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("姓名"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="index.asp"
MM_redirectLoginFailed="no.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_c2_STRING
MM_rsUser.Source = "SELECT 姓名, 密码"
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 密码='" & Replace(Request.Form("密码"),"'","''") & "'"
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 true 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
%>
望高手可以帮忙解答,积分全给(虽然不多).因为怕问题不能解决,这里先设0.解答后必定送上积分.
第14行是: MM_rsUser.ActiveConnection = MM_c2_STRING 展开
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
[Microsoft][ODBC 驱动程序 管理器] 未发现数据源名称并且未指定默认驱动程序
/login.asp,行14 "
当我输入帐号和密码登陆时出现以上问题,数据库一定是连接成功,因为之前已经可以添加,删除信息.但Connections文件夹里没有conn文件,这应该不关事吧.代码如下:
<!--#include file="Connections/c2.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("姓名"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="index.asp"
MM_redirectLoginFailed="no.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_c2_STRING
MM_rsUser.Source = "SELECT 姓名, 密码"
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 密码='" & Replace(Request.Form("密码"),"'","''") & "'"
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 true 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
%>
望高手可以帮忙解答,积分全给(虽然不多).因为怕问题不能解决,这里先设0.解答后必定送上积分.
第14行是: MM_rsUser.ActiveConnection = MM_c2_STRING 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询