Professional Web Applications Themes

access sql problem - ASP Database

Hello guys I have one table called tblUsers which contain userid and password. The table is in microsoft database. Basically I'm developing login page tht validate with table data userid and password. Below is my sql sql = "Select * From tbluser where user_id='"&Request.form ("tx_userid")&"' AND user_password='"&Request.form ("tx_password")&"'" my question is how would I make username case insensitive and password case sensitive.. Pls, keep in mind tht my database in msaccess and it doesnt support upper function in SQL... Thanx in advance.... dave...

  1. #1

    Default access sql problem

    Hello guys
    I have one table called tblUsers which contain userid and
    password. The table is in microsoft database.

    Basically I'm developing login page tht validate with
    table data userid and password.

    Below is my sql
    sql = "Select * From tbluser where user_id='"&Request.form
    ("tx_userid")&"' AND user_password='"&Request.form
    ("tx_password")&"'"

    my question is how would I make username case insensitive
    and password case sensitive..
    Pls, keep in mind tht my database in msaccess and it
    doesnt support upper function in SQL...

    Thanx in advance....
    dave
    dave Guest

  2. #2

    Default Re: access sql problem

    Firstly, what happens when someone enters a password like abc'def? Please
    be sure to always handle apostrophes.
    http://www.aspfaq.com/show.asp?id=2035

    I personally do not know of any way to make an Access database case
    sensitive, especially on just a per-column basis. So, it seems to me that
    you'd want to do the comparison in your code instead of in your query.
    Example:

    Dim bFine : bFine = False
    sPassword = Request.Form("tx_password")
    sql = "SELECT user_password FROM tblUser WHERE user_id='" &
    yourApostropheFunction(Request.Form("tx_userid") & "'"
    Set oRS = yourADOConnection.Execute(sql)
    If Not oRS.EOF Then
    If oRS.Fields.Item(0).Value = sPassword Then
    '''passwords match
    '''VBScript is case sensitive when comparing strings
    '''
    '''your code here for valid login
    bFine = True
    End If
    End If

    If bFine Then
    Response.Write "Login successful."
    Else
    Response.Write "Login failed."
    End If

    Ray at home



    "dave" <microsoft.com> wrote in message
    news:405b01c4a44b$8d07fd30$gbl... 


    Ray Guest

  3. #3

    Default Re: access sql problem

    Sorry to be replying to your message Ray. The anonymous account had gotten
    added to my blocked senders list so I don't have the OP to reply to. My
    reply to the OP is below:
     [/ref]

    http://www.devguru.com/Technologies/vbscript/quickref/instr.html
    http://www.kbalertz.com/kb_244693.aspx

    As the second article states, the use of functions against columns in the
    WHERE clause will force an inefficient table scan, so avoid this on large
    tables.

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

Similar Threads

  1. contribute problem - access denied file may not existpermission problem
    By Al1973 in forum Macromedia Contribute Connection Administrtion
    Replies: 6
    Last Post: September 17th, 04:16 PM
  2. pda access WS problem
    By keith bessette via .NET 247 in forum ASP.NET Web Services
    Replies: 0
    Last Post: August 10th, 01:59 AM
  3. iis 5 and access db problem
    By jim carney in forum ASP Database
    Replies: 7
    Last Post: January 9th, 07:19 PM
  4. Replies: 0
    Last Post: August 23rd, 11:56 AM
  5. Conversion problem from Access 97 to Access 2002
    By paul in forum Microsoft Access
    Replies: 0
    Last Post: July 25th, 02:46 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139