|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Security based on Windows LoginI tried Allen Browne's advice on Creating an Audit Log for using users'
Windows Login for security and I keep on having problems. Access's security features are terrible and I've had way too much trouble with it. What I need is this...My boss wants users to only be able to edit the records they created and a history table of what changes and additions were made. It would be nice if they could see all records, but if not then it's okay if they only see theirs. What's the easiest way to go about this? I'm going crazy over here and tearing my hair out with VBA. Please help me. If only simple security is needed (no one is really going to try hacking the
system) then you could try (Environ("Username")) to capture the username of the logged in user. This works if each person who has access to the database has a different windows login. For example: Dim Username as String Username = (Environ("Username")) msgbox (Username) I personally would add an extra field to the table, called USER. When a user opens a new record (Environ("Username")) is automatically entered into the USER field. Then all you have to do is do a small loop proceedure that runs through all of the records looking at USER. Not exact syntax!: BEGIN LOOP If USER = CURRENT USER (Environ("Username")) then 'Do nothing, employee is allowed to access this record ELSE 'Disable/Lock record End If NEXT ITEM IN LOOP Hope this helps, let me know how you get on. -- Dan Walters Show quote "Adriana" wrote: > I tried Allen Browne's advice on Creating an Audit Log for using users' > Windows Login for security and I keep on having problems. Access's security > features are terrible and I've had way too much trouble with it. > > What I need is this...My boss wants users to only be able to edit the > records they created and a history table of what changes and additions were > made. It would be nice if they could see all records, but if not then it's > okay if they only see theirs. > > What's the easiest way to go about this? I'm going crazy over here and > tearing my hair out with VBA. Please help me. Thank you for responding and for your assistance. An I.T. employee helped me
with all the coding for the security and the changes made audit table. The code is pretty long, so it's a little too long to paste here. Show quote "DanielWalters6" wrote: > If only simple security is needed (no one is really going to try hacking the > system) then you could try (Environ("Username")) to capture the username of > the logged in user. > This works if each person who has access to the database has a different > windows login. > > For example: > > Dim Username as String > Username = (Environ("Username")) > msgbox (Username) > > I personally would add an extra field to the table, called USER. > When a user opens a new record > (Environ("Username")) is automatically entered into the USER field. > > Then all you have to do is do a small loop proceedure that runs through all > of the records looking at USER. Not exact syntax!: > > BEGIN LOOP > If USER = CURRENT USER (Environ("Username")) then > 'Do nothing, employee is allowed to access this record > ELSE > 'Disable/Lock record > End If > NEXT ITEM IN LOOP > > Hope this helps, let me know how you get on. > > -- > Dan Walters > > > "Adriana" wrote: > > > I tried Allen Browne's advice on Creating an Audit Log for using users' > > Windows Login for security and I keep on having problems. Access's security > > features are terrible and I've had way too much trouble with it. > > > > What I need is this...My boss wants users to only be able to edit the > > records they created and a history table of what changes and additions were > > made. It would be nice if they could see all records, but if not then it's > > okay if they only see theirs. > > > > What's the easiest way to go about this? I'm going crazy over here and > > tearing my hair out with VBA. Please help me. Just glad you got it sorted :)
-- Dan Walters Show quote "Adriana" wrote: > Thank you for responding and for your assistance. An I.T. employee helped me > with all the coding for the security and the changes made audit table. The > code is pretty long, so it's a little too long to paste here. > > "DanielWalters6" wrote: > > > If only simple security is needed (no one is really going to try hacking the > > system) then you could try (Environ("Username")) to capture the username of > > the logged in user. > > This works if each person who has access to the database has a different > > windows login. > > > > For example: > > > > Dim Username as String > > Username = (Environ("Username")) > > msgbox (Username) > > > > I personally would add an extra field to the table, called USER. > > When a user opens a new record > > (Environ("Username")) is automatically entered into the USER field. > > > > Then all you have to do is do a small loop proceedure that runs through all > > of the records looking at USER. Not exact syntax!: > > > > BEGIN LOOP > > If USER = CURRENT USER (Environ("Username")) then > > 'Do nothing, employee is allowed to access this record > > ELSE > > 'Disable/Lock record > > End If > > NEXT ITEM IN LOOP > > > > Hope this helps, let me know how you get on. > > > > -- > > Dan Walters > > > > > > "Adriana" wrote: > > > > > I tried Allen Browne's advice on Creating an Audit Log for using users' > > > Windows Login for security and I keep on having problems. Access's security > > > features are terrible and I've had way too much trouble with it. > > > > > > What I need is this...My boss wants users to only be able to edit the > > > records they created and a history table of what changes and additions were > > > made. It would be nice if they could see all records, but if not then it's > > > okay if they only see theirs. > > > > > > What's the easiest way to go about this? I'm going crazy over here and > > > tearing my hair out with VBA. Please help me. |
|||||||||||||||||||||||