Results 1 to 2 of 2

Thread: Authentication

  1. #1
    Conrad Guest

    Default Authentication

    I am new to ADO(I do know a bit thought) and need some good soul to show me the basic idea (any code would help) of authenticating a user against two fields in a database(such as username and password).<BR><BR>Thanks for your help.<BR><BR>Conrad

  2. #2
    SPG Guest

    Default RE: Authentication

    set objConn = server.createObject("ADODB.connection")<BR>objConn .open "-- Your Connection String Here --"<BR>set objRS = objConn.execute("select count(*) from usersTable where userName = &#039" & request.form("userName") & "&#039 and password = &#039" & request.form("password") & "&#039")<BR>if objRS.eof then<BR> &#039 User was not authenticated!<BR>elseif objRS(0) = 0 then<BR> &#039 User was not matched!<BR>else<BR> &#039 User was found in the database.<BR>end if<BR>objRS.close<BR>set objRS = nothing<BR>objConn.close<BR>set objConn = nothing<BR><BR><BR>Note that ADO gets a lot easier when you start writing wrappers to do your database connecting and recordset fetching...

Posting Permissions

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