Field Verification

J

Jay974

Hi
I am designing a database for a call centre which will be used every
interaction with a customer. Part of the verification will be to confirm two
random characters from a passcode. I don't want the passcode to display to
the agent. The field will be alphanumeric and will vary in length.

I am using Access 2003 as a FE and MS SQL 2000 on the BE
Is there any way I can do this and how secure is it?

Thanks
 
K

Klatuu

Don't quite understand the question. But what I think you said is the aqent
will be presented with two of chararcters from a passcode.
The user will know the passcode.
The agent cannot see the entire passcode, only two randomly selected
characters from the passcode.

Is that what you are trying to accomplish?
 
J

Jay974

Yes.
What I am trying to achieve is that, when the agent retrieves the record,
they will have to enter two random characters provided by the customer
however, the database will determine which characters. e.g. the system will
ask "please enter character 1 and 4 from the customers passcode" The agent
will ask the customer for this information and enter into two text boxes. If
the characters match with what is stored in the table, they are given access
to the record otherwise, it will ask again. Obviously, I wouldn't want it to
always enter 1 and 4.
 
K

Klatuu

Okay. Here are two functions that will accomplish what you want. The
comments in the code explain how the functions work.

First you pass the password to PickTwo which will return the two numbers
based on the length of the password.

Then you pass the password, the string with the two number returned from
PickTwo, and the two characters supplied by the customer to VerifyTwo. If
the characters supplied by the customer match the characters in the password,
True is returned. If they do not, False is returned.

The comparison is case sensitive, so "x" does not = "X"

I would suggest you start with a command button to get the two numbers:

Private Sub cmdGetNumbers_Click()
Me.txtTwoNumbers = PickTwo(DLookup("[PWd]", "tblCustomer", _
"[CustID] = " & Me.txtCustID))
End Sub

Then when the agent gives the numbers to the customer and the customer
responds with the characters, the agent will type the two characters into a
text box. Use the After Update event of the text box to verify the
characters:

Private Sub txtCheckChars_AfterUpdate()

If Not VerifyTwo(DLookup("[PWd]", "tblCustomer", _
"[CustID] = " & Me.txtCustID), Me.txtTwoNumbers, Me.txtCheckChars)
Then
MsgBox "Password Not Valid"
Me.txtTwoNumbers = Null
Me.txtCheckChars = Null
Me.cmdGetNumbers.SetFocus
End Sub

'---------------------------------------------------------------------------------------
' Procedure : PickTwo
' DateTime : 6/4/2008 09:13
' Author : Dave Hargis
' Purpose : Generate two random numbers in ascending order
' : Minimum number will be 1, Maximum number will be the length of
the
' : String passed
' Returns : A string with the two generated numbers separated by a comma
and a space
' Example : Numbers generated are 8 and 3
' : The return will be "3, 8" (the qoutes are not returned)
' : The Do Loop ensures duplicated numbers will no be returned
'---------------------------------------------------------------------------------------
'
Public Function PickTwo(strPassword As String) As String
Dim lngFirstNumber As Long
Dim lngSecondNumber As Long
Dim lngCheckNumber As Long

Randomize
Do Until lngFirstNumber <> lngSecondNumber
lngFirstNumber = Int((Len(strPassword) * Rnd) + 1)
lngCheckNumber = Int((Len(strPassword) * Rnd) + 1)
If lngCheckNumber < lngFirstNumber Then
lngSecondNumber = lngFirstNumber
lngFirstNumber = lngCheckNumber
Else
lngSecondNumber = lngCheckNumber
End If
Loop
PickTwo = CStr(lngFirstNumber) & ", " & _
CStr(lngSecondNumber)
End Function

'---------------------------------------------------------------------------------------
' Procedure : VerifyTwo
' DateTime : 6/4/2008 09:27
' Author : Dave Hargis
' Purpose : Checks to see if the two character positions selected in the
password
' : match the characters actually in the password
' : The check is case sensitive
' Arguments : strPassword - The password to verify
' : strPositions - The two positions to compare - a string of two
numbers
' : in ascending order separated by a comma and a space
' : strChars - The two characters that should be in the positions in
' : strPassword defined by the two numbers in strPositions
'---------------------------------------------------------------------------------------
'
Public Function VerifyTwo(strPassword As String, _
strPositions As String, strChars As String) As Boolean
Dim varCheck As Variant
Dim lngFirstChar As Long
Dim lngSecondChar As Long

varCheck = Split(strPositions, ",")

VerifyTwo = (Asc(Left(strChars, 1)) = Asc(Mid(strPassword, varCheck(0),
1)) And _
Asc(Right(strChars, 1)) = Asc(Mid(strPassword, varCheck(1), 1)))
End Function
 
T

Tony Toews [MVP]

Jay974 said:
I am designing a database for a call centre which will be used every
interaction with a customer. Part of the verification will be to confirm two
random characters from a passcode. I don't want the passcode to display to
the agent. The field will be alphanumeric and will vary in length.

Why not just make the passcode a hidden field on the form. Then
create an unbound field called passcodeentered. Or something like
that. Then have the agent enter the entire passcode in that field and
use some VBA code in the AfterUpdate event to verify that the two
fields are the same.

I also suspect that the agents are going to have great difficulty
remembering which is the 1st and the 4th, or whatever characters.
It'll be a lot quicker if they just enter the entire passcode.
Otherwise I suspect they'll have to write it down on a piece of paper,
figure out which is when and enter it. In the meantime there will be
a pause in dealing with the customer which could be a while.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
J

Jay974 via AccessMonster.com

Klatuu, thanks very much for that. Did the job nicely.

Tony - in an ideal world, that would be great however, the agent could not be
in posession of the entire passcode as it is used for other features and only
the customer should know this. Thanks for your input though.
 
T

Tony Toews [MVP]

Jay974 via AccessMonster.com said:
Klatuu, thanks very much for that. Did the job nicely.

Tony - in an ideal world, that would be great however, the agent could not be
in posession of the entire passcode as it is used for other features and only
the customer should know this. Thanks for your input though.

So the agent is going to ask the user for the first and fourth
character of the pass code?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top