asp database passwords

Results 1 to 2 of 2

Thread: asp database passwords

  1. #1
    Join Date
    Dec 1969

    Default asp database passwords

    Hi, <BR> <BR>does any one know where I can find an asp code that will access a database of passwords only using one field ie: no username required just a password. <BR> I am new to asp but need this code asap<BR>many thanks <BR> <BR>Jo Warren <BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: asp database passwords

    Based on your question, I am guessing that there are at least 7 things that you need to be concerend about. These are:<BR><BR>MDAC, Database, User-entered value, Connection, SQL Statement, Recordset, Conditional action<BR><BR>MDAC: <BR>Is your computer set up to use ADO (ActiveX Data Objects)<BR><BR>Database: <BR>What database are you using. This will affect your ConnectionString. (See Connection below)<BR><BR>User-entered value: <BR>Do you know how to write the code to get a value from the user?<BR>sPWD = Request.Form("txtPassword")<BR><BR>Connection:<BR> Do you know what an ADODB.Connection object is and how you use it to talk to a database?<BR><BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en ConnectionString<BR><BR>SQL Statement:<BR>Do you know how to ask a database for data?<BR><BR>sSQL = "Select Count(*) From Passwords Where Password = &#039;" & sPWD & "&#039;"<BR><BR>Recordset:<BR>Do you know how to get that data back from the database?<BR><BR>Set rst = Server.CreateObject("ADODB.Recordset")<BR>rst.Open sSQL, conn<BR><BR>Conditional action:<BR>Do you know what you are going to do once you discover whether or not the user entered a valid password?<BR><BR>If IsNull(rst(0)) Then<BR> Response.Write "SOL, dude. That Password doesn&#039;t exist."<BR>Else<BR> &#039;go to the next page<BR>End If<BR><BR>And then be sure to close and destroy the recordset and the connection<BR>rst.Close<BR>Set rst = Nothing<BR>conn.Close<BR>Set conn = Nothin<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