Hiding a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My app has a table of user logon info. Certain people are assigned to be able to add/modify users, but I want to be able to hide the password of the person with highest access for the app. Is there a way to just hide one record in a table from all but specific people? Or is there a way to encrypt a password field for just one record?
 
I know of no way to do this on a table level.
One way to "slightly" hide the table is to set its Hidden property to True
and make sure the Option to show Hidden files is not checked.

You should still be able to access the table through a form, where you can
do some coding to do the checking you want.

HTH
- Turtle

ctdak said:
My app has a table of user logon info. Certain people are assigned to be
able to add/modify users, but I want to be able to hide the password of the
person with highest access for the app. Is there a way to just hide one
record in a table from all but specific people? Or is there a way to
encrypt a password field for just one record?
 
ctdak said:
My app has a table of user logon info. Certain people are assigned to be
able to add/modify users, but I want to be able to hide the password of the
person with highest access for the app. Is there a way to just hide one
record in a table from all but specific people? Or is there a way to
encrypt a password field for just one record?
You can "hide" a password field by using an input mask in the table and
form. Set the property to "Password" without the quotes.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
I am already using the "password" input mask for the actual logon form. What I'm talking about here is the form where certain assigned users maintain the user logon info. They can see and modify user logon passwords. However, I don't want them seeing and modifying the password of the application administrator. That's the one I want to hide. Perhaps I can do this with VBA code - by replacing or hiding the display of the password control for that user only?
 
a simple function to encrypt / decrypt data

Private Function EncryptDecrypt(Byval InBuffer As String,Optional Byval key
As String="yourPersonalKey") As String
Dim Key As String, HHH As String, SBox As String, Texti As String
Dim Text1 As String
Dim t As Long, i As Long, C As Long, k1 As Long, k2 As Long
Dim k As Long, F As Long, j As Long, h As Long, s As Long
On Error Resume Next
Key = Password
For i = 1 To 256
k1 = VBA.Asc(Mid(Key, i, 1))
k2 = VBA.Asc(VBA.Mid(Key, k1 + i Mod Len(Key), 1))
C = (C ^ 2) Mod (C * 2)
C = C + (k1 * 2 - k2) Mod 256
C = C + (k1 * 2 + k2 * 2) Mod (k1 * 2)
C = C + (k1 * 2 + k2 * 2) Mod (k2 * 2)
C = C Xor i Mod 256
HHH = HHH & VBA.Chr(C Mod 256 + 1)
Next i
SBox = HHH
Key = Password
Texti = InBuffer
Text1 = ""
For i = 1 To Len(InBuffer)
C = VBA.Asc(VBA.Mid(InBuffer, i, 1)) - 1
k = VBA.Asc(VBA.Mid(Key, i Mod Len(Key), 1))
F = k
j = (j + i) Mod 256
t = (t + j) Mod 256
h = (h + Asc(Mid(SBox, t, 1)) + Asc(Mid(SBox, j, 1))) Mod 256
s = (s + Asc(Mid(SBox, h + t Mod 256, 1)) + Asc(Mid(SBox, h + i, 1)) +
Asc(Mid(SBox, h + j, 1))) Mod 256
F = (F Xor i Xor j Xor t Xor h Xor s) Mod 255
F = (F Xor j Xor t Xor h Xor s) Mod 256
F = (F Xor t Xor h Xor s) Mod 255
F = (F Xor h Xor s) Mod 256
F = (F Xor s) Mod 255
F = F + (i + j + t + h + s Mod 256)
F = F + (j + t + h + s Mod 256)
F = F + (t + h + s Mod 256)
F = F + (h + s Mod 256)
F = F + (s Mod 256)
F = F Mod 256
C = C Xor F
C = (C Mod 256) + 1
VBA.Mid(Texti, i, 1) = VBA.Chr(C)
Next i
Stream = Texti
End Function

all you have to do is remember the key!

hth

Pieter



ctdak said:
I am already using the "password" input mask for the actual logon form.
What I'm talking about here is the form where certain assigned users
maintain the user logon info. They can see and modify user logon passwords.
However, I don't want them seeing and modifying the password of the
application administrator. That's the one I want to hide. Perhaps I can do
this with VBA code - by replacing or hiding the display of the password
control for that user only?
 
By the way
You should rather rely on "proper" security ...

Pieter

ctdak said:
I am already using the "password" input mask for the actual logon form.
What I'm talking about here is the form where certain assigned users
maintain the user logon info. They can see and modify user logon passwords.
However, I don't want them seeing and modifying the password of the
application administrator. That's the one I want to hide. Perhaps I can do
this with VBA code - by replacing or hiding the display of the password
control for that user only?
 
What do you mean by "proper" security?


Pieter Wijnen said:
By the way
You should rather rely on "proper" security ...

Pieter


What I'm talking about here is the form where certain assigned users
maintain the user logon info. They can see and modify user logon passwords.
However, I don't want them seeing and modifying the password of the
application administrator. That's the one I want to hide. Perhaps I can do
this with VBA code - by replacing or hiding the display of the password
control for that user only?
 
What do you mean by "proper" security?

Passwords are of very limited utility, and can easily be broken.
They're like a $6.95 bicycle lock.

Invoking full Access workgroup security - while it's not Fort Knox -
provides both a lot better security and a great deal more flexibility;
you can have different groups of users with graded permissions (no
privileges at all, read only, read but not add, add but not read, edit
data but no design changes, ...) to any object in the database.
 
Thanks for the answer John. Does using Access workgroup security allow the application to be portable across different versions of Access and Windows? I have no experience with it. I'm currently using my own security built-in to the app partly because my thinking is that it makes the app more portable - not dependent upon a particular version of Access or of Windows.

ctdak
 
I figured out the answer to my own question. I simply open the user logon table with VBA using a query that shows all records but the one in question. The users cannot access the tables or queries directly, so this solves it. (This is a "turnkey" app.) The hidden record belongs to the app developer who can of course still modify it directly.

ctdak
 
Thanks for the answer John. Does using Access workgroup security allow the application to be portable across different versions of Access and Windows? I have no experience with it. I'm currently using my own security built-in to the app partly because my thinking is that it makes the app more portable - not dependent upon a particular version of Access or of Windows.

Yes, it does; security is enabled in all versions of Access since (at
least) 2.0. You need to distribute the .MDW workgroup file along with
the database. Get a copy of the Security FAQ from Microsoft, or from
the CompuServe forum in my .sig (search the Files for SECFAQ2K.ZIP)
and read it carefully. It's moderately complicated to implement and
can be done wrong so study the FAQ with care!
 
Back
Top