Results 1 to 2 of 2

Thread: ???

  1. #1
    Join Date
    Dec 1969

    Default ???

    hmm...why do I get this? <BR><BR>Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record. <BR><BR>on line 14 <BR><BR><BR>&#060;% <BR>If Request("Action") = LoginButton Then <BR> Set DB = Connect() <BR> SQL = "SELECT * FROM Login WHERE Email = &#039;" + Request("Email") + "&#039;" <BR> Set RS = DB.Execute (SQL) <BR> &#039;line 14 <BR> password=RS("Password") <BR><BR> If (RS.EOF And RS.BOF) Then <BR> Session (SiteID + "Authentication") = False <BR> Response.Redirect ("forgotpassword.asp?Error=Email+does+not+exist .") <BR> Else <BR> Session (SiteID + "Email") = RS("Email") <BR> Session (SiteID + "Authentication") = True <BR> <BR> <BR>Dim objMail, Rs, Password <BR>Set objMail = Server.CreateObject("CDONTS.NewMail") <BR><BR>Dim sendSubj <BR>sendSubj = sendSubj & "Passwordis: " & password & vbCRLF <BR><BR>objMail.From = "something@aol.com" <BR>objMail.Subject = "User Information" <BR>objMail.To = "something@aol.com" <BR>objMail.Body = sendSubj <BR><BR>Response.Write("Email has been sent") <BR>objMail.Send <BR>&#039;You should always do this with CDONTS. <BR>set objMail = nothing <BR> <BR> End If <BR>End If <BR>%&#062; <BR><BR>anyone?

  2. #2
    Join Date
    Dec 1969

    Default Don't access a collection without checking

    If the execution of the SQL doesn&#039;t return a recordset (no records found), you&#039;ll get an error because you&#039;re trying to access the value in the field password when there are no records in the recordset object.<BR><BR>You need to move the line,<BR> password=RS("Password")<BR><BR>inside the IF..THEN block,<BR><BR>If (RS.EOF And RS.BOF) Then <BR> ...<BR>Else<BR> password=RS("Password")<BR> ...<BR>End If<BR><BR><BR>** For future posts, make sure you provide a descriptive subject line for your posts.<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