Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2016

    Unanswered: Case Sensitive Password Trouble

    For reference, I found some help at:

    I am using a modal form for my log in/password validation. My user information is stored in 'tblUser'. The records I am pulling from are 'UserLogin' and 'Password'. on the modal form, the login name is 'txtUserName' and password name is 'txtPassword'.

    here is a snipit of my code..

    Private Sub Command1_Click()

    Dim user As String
    Dim userlevel As Integer
    Dim TempPass As String
    Dim ID As Integer
    Dim UserName As String
    Dim TempLoginID As String
    Dim password As String

    If IsNull(Me.txtUserName) Then
    MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
    ElseIf IsNull(Me.txtPassword) Then
    MsgBox "Please enter Password", vbInformation, "Password Required"
    If StrComp(Me.txtPassword.Value, (DLookup("[Password]", "[tblUser]", "[UserLogin]= " & Me.txtUserName.Value)), vbBinaryCompare) = 0 Then
    MsgBox "Incorrect LoginID or Password" & vbNewLine & "Please contact an administrator for login information", vbInformation, "Incorrect Password Required"

    the portion in red is returning ""un time error 2471, the expression you entered as query paramater produced this error: 'michael' " (michael is username I am entering).

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    As [UserLogin] is a string (Text in SQL) in the table [tblUser] you should use:
    ... "[UserLogin]= '" & Me.txtUserName.Value & "'"
    More generally, you should try to use the Windows login of the users instead of trying to build your own system. See:
    Have a nice day!

Posting Permissions

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