'Enhancing the Login page'
Hey to all. In the DWMX04 book Chapter 11, 'Enhancing the Login page'. I get the following message when I try to login.
-----------------------------------
ADODB.Recordset.1 error '800a0e78'
Invalid operation on closed object
/html/login.asp, line 22
-----------------------------------
Can anyone, (Imar) if your out there, suggest what I have done wrong this time. I have included a little code below.
8 If MM_valUsername <> "" Then
9 MM_fldUserAuthorization=""
10 MM_redirectLoginSuccess="search.asp"
11 MM_redirectLoginFailed="login.asp"
12 MM_flag="ADODB.Recordset"
13 set MM_rsUser = Server.CreateObject(MM_flag)
14 MM_rsUser.ActiveConnection = MM_connTheSoccerSite_STRING
15 MM_rsUser.Source = "SELECT Name, Password"
16 If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source
& "," & MM_fldUserAuthorization
17 MM_rsUser.Source = MM_rsUser.Source & " FROM Users WHERE Name='" & Replace
(MM_valUsername,"'","''") &"' AND Password='" & Replace(Request.Form
("txtPassword"),"'","''") & "'"
18 MM_rsUser.CursorType = 0
19 MM_rsUser.CursorLocation = 2
20 MM_rsUser.LockType = 3
21 MM_rsUser.Open
22 If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
23 ' username and password match - this is a valid user
24 Session("MM_Username") = MM_valUsername
25 If (MM_fldUserAuthorization <> "") Then
26 Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item
(MM_fldUserAuthorization).Value)
27 Else
28 Session("MM_UserAuthorization") = ""
29 End If
30 if CStr(Request.QueryString("accessdenied")) <> "" And false Then
31 MM_redirectLoginSuccess = Request.QueryString("accessdenied")
32 End If
33 MM_rsUser.Close
34 Response.Redirect(MM_redirectLoginSuccess)
35 End If
36 MM_rsUser.Close
37 Response.Redirect(MM_redirectLoginFailed)
38 End If
39 %>
40
41 <%
42 ' *** Validate request to log in to this site.
43 MM_LoginAction = Request.ServerVariables("URL")
44 If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" +
Request.QueryString
45 MM_valUsername=CStr(Request.Form("txtUserName"))
46 If MM_valUsername <> "" Then
47 MM_fldUserAuthorization=""
48 MM_redirectLoginSuccess="search.asp"
Thank you
Mal.
|