Conforming

Results 1 to 3 of 3

Thread: Conforming

  1. #1
    Raymond Guest

    Default Conforming

    I have a script that logs in a user dependent on whether they&#039re email address/password matches that in the database. I do a <BR>"select * from database where email=" & strFormEmail<BR>Now it works fine, but the problem comes when the persons email address doesn&#039t exist in the database, it pops up an error stating that rs.bof or rs.eof is true blah blah blah (because no records match that email address). I want it instead to take them to a page that says userid not found or was type incorrectly, please reenter, etc.. How do I do that? I was thinking more on the lines of cycling through each record in the database and checking first, but that would mean it is cycling through the database twice, which when we get more users would really suck. Please help me on either score (even if i HAVE to cycle through twice).<BR><BR>Raymond

  2. #2
    Join Date
    Dec 1969
    Posts
    170

    Default RE: Conforming

    you can check the recordset for eof. if true (i.e. no records match the condition) redirect the user to another page and display the error message there. this is one way instead of going through the db twice

  3. #3
    besharah Guest

    Default RE: Conforming

    Sounds like your bringing a recordset back from the database with the "matching" row. If there are no matches, i.e it&#039s a bad login, then the recordset&#039s EOF (END OF FILE) property will be set to true.<BR><BR>You can write code to check for this condition:<BR><BR>if rs.eof = true then<BR>response.redirect("anotherpage, or back to itself")<BR>else<BR> ---Log in user<BR>end if <BR><BR><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
  •