log on page problem

Results 1 to 2 of 2

Thread: log on page problem

  1. #1
    Join Date
    Dec 1969

    Default log on page problem

    Hey, I&#039;m trying to get a login page working. If username and password are true then it should write 5 back to Flash. If either username or password are bad it should write 6 to Flash. <BR>I setup Access with username=8 and password=7. When I run it with a true username (ie. change the code below from strusername=89 to strusername=8) it works when I run it in browser. However, with the username not being found in the db I get the following error. <BR><BR>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.<BR><BR>How do I get around this problem which I guess occurs because there are no record in the recordset?<BR><BR>Thanks<BR><BR>straccess=5<BR>str denied=6<BR><BR>strpassword=7<BR>strusername=89<BR ><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en("contactus")<BR>sql = "SELECT fldusername, fldpassword FROM tblusers WHERE fldusername = &#039;"&strusername&"&#039;"<BR>Set rsRecords = Conn.Execute(sql)<BR>strusername = rsRecords("fldusername")<BR>strpassword = rsRecords("fldpassword")<BR>If Not rsRecords.EOF And Not rsRecords.BOF Then<BR> If strpassword = rsRecords("fldpassword") Then<BR> response.write"&login" & "=" & straccess<BR> rsRecords.Close<BR> Conn.Close<BR> Set Conn = Nothing<BR> Else<BR> &#039;Invalid password handling goes here<BR> response.write"&login" & "=" & strdenied<BR> End If<BR>Else<BR>&#039;Invalid username handling goes here<BR> response.write"&login" & "=" & strdenied<BR>End If

  2. #2
    Join Date
    Dec 1969

    Default obvious

    strusername = rsRecords("fldusername")<BR>strpassword = rsRecords("fldpassword")<BR><BR>what&#039;s this assignment doing outside the if/else? drop it and all will be well. can&#039;t believe this post has lingered for this long.<BR><BR>j<BR>http://www.atrax.ws/<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts