help needed! I am new to asp!

Results 1 to 2 of 2

Thread: help needed! I am new to asp!

  1. #1
    randy Guest

    Default help needed! I am new to asp!

    I am trying to create a login checking mechanism by using data stored in Microsoft Access. May I know how to continue the coding below by comparing each of the individual login_ID on the access database with the login_ID keyed onto the HTML?<BR><BR>&#060;%<BR> // Name of the AccessDB<BR> accessdb = "c:Project Testinguser_profile.mdb"<BR><BR> // Connection to the db<BR> objConn = "DRIVER = {Microsoft Access Driver (*.mdb)};"<BR> objConn = objConn & "DBQ=" server.mapPath(accessdb)<BR><BR> // Create a server record set object<BR> set objRS = server.createobject("ADODB.RecordSet")<BR><BR> sql = "select * from User_name, Password"<BR><BR> // Execute the sql<BR> objRS.Open sql, objConn <BR>%&#062;<BR><BR>p.s: new ideas on creating a much more efficient checking mechanism is welcome<BR><BR>thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: help needed! I am new to asp!

    You need a page that the user enters their username into, or a cookie could be used for the same purpose. Anyway, modify your sql statement like this:<BR><BR>"select * from User_name, Password where fieldname = &#039" & Request("username") & "&#039"<BR><BR>The Request object takes information from a form field or the url querystring. The above example assumes you are passing a variable called "username" to this hypothetical asp page. Assuming a match is found, you&#039re good to go. If a match is not found, a message to the user would be helpful. ;-)<BR><BR>One other thing occurs to me: are User_name and Password tables in your database or fields in one table? The sql statement I wrote above assumes they are tables. If they are fields, use this sql statement:<BR><BR>"select User_name, Password from tablename where User_name = &#039" & Request("username") & "&#039"<BR><BR>Hope this helps.

Posting Permissions

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