Either BOF or EOF is True, or the current record has been deleted...

knowledge76

Registered User.
Local time
Today, 11:58
Joined
Jan 20, 2005
Messages
165
The problem arrises in then line " dsuser.Find criteria, 0, adSearchForward, 1 " and an error message is shown "Either BOF or EOF is True, or the current record has been deleted; the operation you ". I am just not getting the right idea o solve it. here is that piece of code.
Code:
rs.Open _
      "Valid Users", _
      conn, adOpenDynamic, adLockOptimistic
      
  criteria = "[User] = """ & Forms![Login]!user & """"
  
  ' FindFirst implementation
 
  rs.Find criteria, 0, adSearchForward, 1
  
  If rs.EOF = False Then
    If rs!password = Forms![Login]!password Then
      loc_fname = rs![f_name]
      
        ..................
...............
.........
.....
 
I the problem may be with the line
criteria = "[User] = """ & Forms![Login]!user & """"

THe line should be
criteria = "[User] = '" & Forms![Login]!user & "'"
 
Last edited:
faradhi said:
I the problem may be with the line
criteria = "[User] = """ & Forms![Login]!user & """"

THe line should be
criteria = "[User] = '" & Forms![Login]!user & "'"

There's no difference except that the original is more robust and your suggestions 'crashes' when a name contains an apostrophe. ;)
 
SJ McAbney said:
There's no difference except that the original is more robust and your suggestions 'crashes' when a name contains an apostrophe. ;)

what do u mean by apostrophe?
 
My approach would be to only open the recordset on the exact data I was looking for, so something like,
Code:
With rs
   .Open "SELECT user FROM tUsers " & _
      "WHERE user = """ & Forms!Login.User & """ " & _
      "AND password = """ & Forms!Login.Password & """", etc...
   If .EOF Then 
      MsgBox "Access Denied"
   End If
   .Close
End With
I don't know how to use "Finds" or "Seeks" on recordsets since it always seems more efficient to apply those criteria to the original query, and if .EOF then you didn't find it.
 
Well With my code given above I am just accessing the first record and I have 10 records in my table and the one record that i am accessing is not compared by the user name and password entered by the user and that is why my application is not going forward. Am i lacking some hardware or sofwtare component? or what is the reason?
 
If you're not getting the records you expect, check the query "Valid Users" on which you open your recordset.
 

Users who are viewing this thread

Back
Top Bottom