Very Basic SQL question "Login"

Results 1 to 2 of 2

Thread: Very Basic SQL question "Login"

  1. #1
    Join Date
    Dec 1969

    Default Very Basic SQL question "Login"

    Hello, <BR><BR>I am creating a web application using sql server 2000, and ado, and I was just wondering about the best way to authenticate a user.<BR><BR>I am using stored procedures, but should I do a select and then see if the recordset is empty, or return the @@rowcount and check to see if there is one or zero rows? Does it matter?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Very Basic SQL question

    CREATE PROC....<BR>@params<BR><BR>AS<BR><BR>IF EXISTS(SELECT UserName FROM users where Username = ... )<BR>BEGIN<BR> SELECT 1<BR>END<BR>ELSE<BR>BEGIN<BR> SELECT 0<BR>END<BR><BR>call it like<BR><BR>If MyConnection.Execute("spCheckLogin &#039;Username&#039;, &#039;PWD&#039;").Fields(0).Value = 1 then<BR>&#039;OK<BR>else<BR>&#039;whoops<BR>end if<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