Empty Recordsets

Results 1 to 2 of 2

Thread: Empty Recordsets

  1. #1
    Join Date
    Dec 1969

    Default Empty Recordsets

    I have a web-form which accepts data for adding a new employee to my system. Their name must be entered as well as a unique login id and password. I then want to check whether or not the login ID entered belongs to any other users....<BR><BR>I envisage doing this by having a query "select * from Employee where LoginID=&#039;" & login_id & "&#039;"....then if the resultant recordset is empty, I will know that nobody has that login id...my problem is, how do you check whether a recordset is empty or not???? I am using the format<BR> set rs = conn.Execute(query)<BR><BR>I envisage writing something like:<BR> rs.MoveFirst<BR> if rs.EOF then<BR> &#039;must be empty<BR> else<BR> &#039;somebody has that login<BR><BR>Is this correct? My main concern is that the line &#039;rs.MoveFirst&#039; won&#039;t be very popular if rs is empty???<BR><BR>Any clarification anyone could offer would be good :)

  2. #2
    Join Date
    Dec 1969

    Default RE: Empty Recordsets

    Take the rs.MoveFirst out completely.<BR><BR>If you&#039;ve just opened the reocrdset, you&#039;ll always be at the beginning of the recordset.<BR><BR>This part:<BR><BR>if rs.EOF then<BR>&#039;must be empty<BR>else<BR>&#039;somebody has that login<BR><BR>Is all that you&#039;ll need.

Posting Permissions

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