Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2005, 06:07 AM
Authorized User
 
Join Date: Aug 2005
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default '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.

 
Old August 26th, 2005, 08:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Change your code to this and see what you get:

20 MM_rsUser.LockType = 3
Response.Write("Sql is " & MM_rsUser.Source)
Response.End
21 MM_rsUser.Open
22 If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then


Do you get a valid SQL statement?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Page kumar.deepak1984 JSP Basics 1 May 12th, 2008 06:41 AM
Login page back to original page pablohoney Classic ASP Basics 1 October 3rd, 2006 07:09 PM
LOGIN PAGE (does not link to the next page) [email protected] Classic ASP Databases 7 April 5th, 2006 01:28 PM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 07:47 AM
enhancing the dropdownlist jaisonkmathews General .NET 3 September 27th, 2004 01:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.