Microsoft Access Encrypt Field provide you with a good idea of protecting your passwords. So, if your business uses Microsoft Access application to manage any kind of sensitive data, then it would be better to encrypt the passwords of your users.
Since encryption is sort of applying a mathematical algorithm to a specific field or string of characters, you could create your own code. However, the below VBA (Visual Basic for Application) code is a sample of encryption and decryption of Microsoft Access fields.
Keep in mind that medium to advanced programmers can easily decrypt these codes if the database is accessible to them. Therefore, you can always find other methods to secure your database.
Microsoft Access Encrypt Field
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Function NewPass(ByVal UPass As String) As String Dim iIndex As Integer Dim iEncoder As Integer Dim iEncodeVal As Integer Randomize For iIndex = 1 To Len(UPass) Do iEncoder = Int(94 * Rnd + 32) iEncodedVal = Asc(Mid(UPass, iIndex, 1)) Xor iEncoder Loop While iEncodedVal = 127 Or iEncodedVal < 32 NewPass = NewPass & Chr(iEncodedVal) & Chr(iEncoder) Next iIndex End Function |
Microsoft Access Decrypt Field
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Function DecryptPass(ByVal UPass As String) As String Dim iIndex As Integer Dim iDecodedVal As Integer DecryptPass = "" For iIndex = 1 To Len(UPass) Step 2 iDecodedVal = Asc(Mid(UPass, iIndex, 1)) Xor Asc(Mid(UPass, iIndex + 1, 1)) DecryptPass = DecryptPass & Chr(iDecodedVal) Next iIndex End Function |
Moreover, you can download the below sample database which uses the above method to encrypt and decrypt a user password.
An alternative way to encrypt or decrypt Microsoft Access Application
Microsoft Access includes a database password utility to secure your application. Therefore, you can encrypt your access database and provide the password to your authorized employees only. So, to encrypt and decrypt Microsoft Access Application, follow these steps:
Encrypt Microsoft Access Application
- Launch Microsoft Access and click “Open” on the File tab.
- Then, navigate to the Access file that you want to encrypt.
- Click the arrow next to the Open button then select “Open Exclusive” from the drop-down menu to open your Access database in Exclusive mode.
- On the File tab, click Info.
- Click Encrypt with Password.
- Enter a password twice to verify and confirm.
- Finally, click OK button.
Decrypt Microsoft Access Application
- Open your encrypted Access database.
- The “Password Required” window appears.
- Enter your password.
- Finally, click the “OK” button.
For more pro MS Access Programs, please visit our home page here.
To use Microsoft Access Programs.
You’ll need to have Microsoft Office installed including the bundle of MS Access or to download the free Microsoft Access 2016 run-time.