Results 1 to 9 of 9

Thread: Login problem

  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: Login problem

    Hi there,

    I got one prob during my login session.
    I'm using ASP and Access as my database.....................
    In my login page, i have 2 textbox which will accept username and password respectively.
    when i key in the username, it basically will accept capital and non-capital word with the password being true.
    How do i change it so that when user key in the username, it will accept only particular case which is very much similar to the username in the database.
    In other word, i want it to be case sensitive.
    Can anyone help me?
    Thanx

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    What is doing the comparison to check these things?? The database or the script? In whatever case are you using a function or sql script or what??

    It can definately be changed, but how depends on how you are doing it now.

  3. #3
    Join Date
    Mar 2004
    Posts
    202
    hi there,
    actually, my asp script will do the comparison instead of the sql statement.the sql statement is just to retrieve the data only which are the username and password.
    i'm not using any function to do this process coz i'm keeping it simple.
    thanx
    Last edited by michaelfg81; 06-04-04 at 03:44.

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    so what function are you using to compare the strings?? or are your just going myPassword == dbPassword??

    in theory you should find the if myPassword = "abcd" and dbPassword = "ABDC" then myPassword == dbPassword should return false.

    (where == is comparison and = is assignment).

    You could use the StrComp function if you wanted.. that might help...

  5. #5
    Join Date
    Mar 2004
    Posts
    202
    hi there,

    actually i'm using SQL statement to compare..........
    and the code is like this

    sqlCode="Select name FROM register WHERE password= '" + pswd + "' and username = '" + userID + "'"
    Set rs=db.Execute(sqlCode)

    if rs.EOF then
    session("statusUser")="KO"
    response.Redirect("login.asp")
    response.End()
    else
    session("statusUser")="OK"
    session("username")=rs("name")
    response.Redirect("index.asp")
    end if
    what do u think?

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Ahhh,... okie,.. then you probably have an issue with you default collation setups (I think that is the right phrase).

    Basically you can set databases and db servers to be case sensitive or case insensitive (also accent sensitive and something else).

    It looks like your database/server has been set up as case insensitive. Probably best to put a post into the applicable database forum and find our how you can fix this.

  7. #7
    Join Date
    Mar 2004
    Posts
    202
    Thanx friend

  8. #8
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Hang on,.. you are using Access right? Perhaps you could right a function to do the check for you? I had a look at the Access help and couldn't see an obvious way to made the db case sensitive.

  9. #9
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    something like this might work....

    SELECT temp.field1
    FROM temp
    WHERE ((StrComp([field1],"username",0)="0")) and ((StrComp([field2],"password",0)="0"))

    I tried it in a little access db and it seemed to work....

Posting Permissions

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