Results 1 to 5 of 5
  1. #1
    PaysonSolutions is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    4

    Post somewhat-security related question: inputmask type of Password

    I have a client who as asked me to do some updates to their application. One of the things they have asked is that I 'secure' the Password filed in their login form.



    I know there is a InputMask type of Password, which obscures the text typed into the Textbox on the form. Also, this InputMask can be applied to the text field of the table which holds the password.

    The login form takes the field.text values for the username and password fields on the form, then builds a query string and performs a select statement via ADODB which is the functional equivalent of the following psuedo-code:

    "select table.password from table where table.username= form.username.text and table.password= form.password.text;"

    If the returned recordset.recordcount > 0, there is a successful login.

    This configuration works fine as long as the InputMask propeties (in the form, AND in the table) are NOT set to password. If Either, or BOTH of the InputMasks are set, the query fails.

    I have confirmed using breakpoints, and the immediate window, that the information being collected from the form is correct, however I cannot determine why the select lookup is failing.

    Any thoughts on the matter are greatly appreciated!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I just tested a query of field with PASSWORD input mask set in table and it works fine.

    Show your exact code for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    PaysonSolutions is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    4
    Please note that the code works as expected, so long as no InputMask is used on the txtboxPassword control, or on the column that stores the password in the database:

    Private Sub cmdLogin_Click()
    On Error GoTo Err_cmdLogin_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim stSQL As String
    Dim objConn As ADODB.Connection
    Dim objRecord As ADODB.Recordset
    Set objRecord = New ADODB.Recordset

    stSQL = "SELECT * FROM Permissions WHERE "
    Forms!login!txtboxUsername.SetFocus
    stSQL = stSQL & "UserGroup = '" & txtboxUsername.Text
    Forms!login!txtboxPassword.SetFocus
    stSQL = stSQL & "' AND Password = '" & txtboxPassword.Text & "'"

    Set objConn = CurrentProject.AccessConnection

    With objRecord
    Set .ActiveConnection = objConn
    .Source = stSQL
    .LockType = adLockOptimistic
    .CursorType = adOpenKeyset
    .Open
    End With

    If objRecord.RecordCount > 0 Then
    stDocName = "Main Form"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , , objRecord("PermissionType")
    Else
    MsgBox "Login is incorrect please try again"
    Me.txtboxPassword.Text = ""

    Exit Sub

    End If

    objRecord.Close
    objConn.Close
    DoCmd.OpenForm "Login", , , stLinkCriteria
    DoCmd.Close

    Exit_cmdLogin_Click:
    Exit Sub

    Err_cmdLogin_Click:
    MsgBox Err.Description
    Resume Exit_cmdLogin_Click

  4. #4
    PaysonSolutions is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    4
    I exported the values in the permissions table, destoryed it, recreated it, and imported the values back in.
    I can now perform successful look ups of records with the password inputmask at the table.
    However, when I change the input mask to password for the textbox in my login form, my lookups fail.

    Please advise ...

  5. #5
    PaysonSolutions is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    4
    I got it ...

    when using the Password inputmask, a different property of the text box needs to be reference.

    NOT txtboxPassword.text (which presumably is the asterisk's)
    YES: txtboxPassword.value (which is the contents masked by the asterisk's)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. InputMask yyyy-mm for Label
    By smaky in forum Queries
    Replies: 5
    Last Post: 11-03-2010, 10:20 AM
  2. Query on related tables question
    By jpkeller55 in forum Access
    Replies: 12
    Last Post: 09-28-2010, 07:18 PM
  3. Query with related tables question
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 09-25-2010, 04:29 AM
  4. Security question
    By maxx3 in forum Security
    Replies: 2
    Last Post: 01-14-2010, 05:27 PM
  5. Access security - Password Recovery tools
    By sreedharreddy in forum Security
    Replies: 1
    Last Post: 04-01-2009, 08:14 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums