Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: Compare with case sensetive

    I have a login form, the user enters his user name and his password, the password will be searched in a table and compared with what the user entered. I noticed by comparison using the equal sign that Acce$$ doesn't differ between capital and small letters.
    Is there a way to force Acce$$ to compare using the case sensetive....
    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by hammbakka
    I have a login form, the user enters his user name and his password, the password will be searched in a table and compared with what the user entered. I noticed by comparison using the equal sign that Acce$$ doesn't differ between capital and small letters.
    Is there a way to force Acce$$ to compare using the case sensetive....
    Thanks
    Hammy,

    The only way I can think to do that would be to use either InStr or StrComp in the query and test the "equalness" of the result (instead of testing if the column equals a value) ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2003
    Posts
    268

    Try writing a function

    Here is an example of a function that I use in a User Class

    Public Function VerifyPassword(Password As String) As Boolean
    Dim strPW As String
    If StrComp(Password, mPassword, 0) = 0 Then
    VerifyPassword = True
    If Password = "newpassword" Then
    strPW = InputBox("Please enter new password", "New Password")
    If ChangePassword(Password, strPW) Then
    VerifyPassword = True
    Else
    VerifyPassword = False
    End If
    End If
    Else
    VerifyPassword = False
    End If
    End Function

    '** end of example code **

    This looks to see what the user password is. By default all user pws are set to 'newpassword'. If this is the case it prompts the user for a new PW then updated the information.

    Hope this helps.

    I have found that using classes to store information for users is a little easier to manage, specifically what access they get etc. If you want more examples on this just let me know.

    MW

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you both for your answer,
    I could manage it using the inster with the option vbBinaryCompare it takes the case sensetivity into consideration

    StrCompare is also a good one, and uses the vbBinaryCompare as a default like instr
    Last edited by hammbakka; 09-13-04 at 03:17.

Posting Permissions

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