By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Access field to hold passwords

P: 3
I am creating a database to store passwords I use for a variety (in excess of 50) user accounts I use for professional accounts and services.
I re-use some passwords at various times, and I want to put all my accounts and passwords into a database for my own use.
Sometimes I will use an existing password but change a letter to capital, and access will not allow me to enter these two in a table field if the field is indexed with no repeats.
To stop redundancy, this field should only hold the actual password once, hence the need to index with no repeats. But access will not see "Bill" and "bill" as distinct and different entries.
Does anyone know of a solution to this situation?
Thanks in advance.
Nov 20 '17 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 15k+
P: 31,411
Have you considered storing the string as a set of hexadecimal digits but whenever you show it, convert it to string format.

EG. "Bill" would be stored as "42696C6C" whereas "bill" would be stored as "62696C6C". This would be easily accommodated by Access as well as work for you. I'd consider obscuring the data too if I were you.
Nov 21 '17 #2

P: 3
Hi NeoPa

Thanks for your reply. I did consider this in a way, but did not know how to calculate the hex digits from the text.

Also, my thought was that the hex digit could be calculated into a separate field, which would be indexed with no repeats. This would check that the password is not being entered more than one time into the table.

At this point I am not too worried about obscuring the passwords. That will come later as I build this database. It is also only for my use, so we will see about that.

So my next step is, how to calculate the hex value into a field that generates it from a field that holds the text password.
Nov 21 '17 #3

Expert Mod 15k+
P: 31,411
Here's a function that will do that for you. Bear in mind there is a Hex() function provided in the VBA library.
Expand|Select|Wrap|Line Numbers
  1. Public Function HexString(strVar As String) AS String
  2.     Dim lngX As Long
  4.     For lngX = 1 To Len(strVar)
  5.         HexString = HexString & Right("0" & Hex(Asc(Mid(strVar, lngX, 1))), 2)
  6.     Next lngX
  7. End Function
Nov 23 '17 #4

P: 3
Thanks for that NeoPa.
Sorry about the time taken to respond, but work has certain time requirements.
I understand the idea of using a function, and I can follow the VBA of the function. But how do you use it in Access?
I don't know how to make this function calculate a value in a field.
Nov 28 '17 #5

Expert Mod 15k+
P: 31,411
Use the {Control}_AfterUpdate() event procedure to set the value of the Field to HexString() of the value entered. Does that make sense?
Nov 29 '17 #6

Post your reply

Sign in to post your reply or Sign up for a free account.