Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protect Access Database from changes by users 5

Status
Not open for further replies.

rokkit99

Technical User
May 30, 2002
20
US
I have an Access 2000 database that I would like to release to a couple of users to use to look up some basic information with.

There is a code field which allows users to enter a code number. After the code number is entered, data is displayed in about 20 different field on the screen.

I would like to allow the users to view the data, and to filter, sort, and search for data on any of the fields, but not allow them to change any of the data, or the form.

A few of the fields have drop down boxes that display data, and I'm concerned that they would change the data here, or change, or add new data.

I would like to somehow Lock? the database to prevent any changes to any of the saved data.

Thanks so Much in advance for any help.

Rokkit99
 
The three-second answer is to give them only one form, and on that form set the Allow Edits/Allow Deletions/Allow Additions properties to False. This will provide good superficial security, as long as they don't know that they can just open the tables directly or set the properties back to 'true'.


The multiple-hour, possible multiple-day answer is to implement full-blown login-based Access security. That is the only TRUE way to protect your data, and it's still not bulletproof. See the below web site for a good explanation of how to get started w/ Access security:

 
do as foolio says, then hide the database window so they cant get access to tables, then create an MDE file which will not allow the users to muck around with the design of the forms, queries etc.(remember to keep a copy of the MDB file on your personal drive in case you need to develop and release a new version later.

Be ALERT - Your country needs Lerts
 
Thanks foolio12 and scottian for your help with this. I have one remaining peice of the puzzle that I'm unable to solve by myself.

When I hide the database window to prevent the user from gaing access to the table, they can click on the Window menu and then unhide the database giving them access to the tables to edit and change them. Is there someway I can prevent them from being able to unhide the database window.

Thanks so Much!

rokkit99
 
there is a way but it involves using popup windows throughout and also some code to completly hide the access window and disable the shift key. i do have an example secure db that has the window hidden and the shift button disabled.
if you want a copy let me know and I'll e-mail it to you, with instructions

Be ALERT - Your country needs Lerts
 
Here is another simple solution without any coding.

Go to Tools and Startup. On this screen select the Form you would like the user to see. Uncheck the option to display the database window as well as allow full menus. Check off any other option you don't want users to have.

Sure they can get to the database by pressing the shift key and opening the database. You can prevent that by a utility I use if you are interested in it then let me know.

:)WB
 
All the above is good! ALSO: Create an MDE file for your users. Then the only mutable objects are queries. You can hide tables & queries from them with the startup option of not showing db window (mentioned above). Get rid of all default menus, etc. too. Then disable the Bypass key with this code routine--no secret about it, it appears in every decent Access programming book. If you trigger it with a hidden form element you can switch it on/off at will, and no one (except those who read this forum and will be clicking all over your forms ;-) ) will be able to undo it.

[tt]Public Const PROPERTY_NOT_FOUND_DAO As Long = 3270

Public Sub ByPassKeyToggle()
'This Code Disables/Enables the Shift Key
On Error GoTo Error_ByPass

Dim Prp As DAO.Property
Dim db As DAO.Database
Dim blnToggle As Boolean

Set db = CurrentDb()

blnToggle = db.Properties("AllowByPassKey")
blnToggle = Not blnToggle

db.Properties("AllowByPassKey") = blnToggle

blnToggle = db.Properties("AllowByPassKey")

MsgBox "AllowByPass is set to " & blnToggle

Exit_Error_ByPass:
Exit Sub

Error_ByPass:

If PROPERTY_NOT_FOUND_DAO Then
Set Prp = db.CreateProperty("AllowByPassKey", dbBoolean, True)
db.Properties.Append Prp
db.Properties.Refresh
Resume Next
Else
MsgBox "Bypass routine failed due to " & Err.Number & ": " & Err.Description
End If
Resume Exit_Error_ByPass

End Sub 'ByPassKeyToggle
[/tt]

Turn your headache into my project!
Jeffrey R. Roberts
Insight Data Consulting
Access and SQL Server Development
 
Thanks to all for the valuable posts. Scottian can you email the utility with instructions on how to use it, and Quehay could you explain where I place the code in access to make it work.

My email address is: jim_r36@yahoo.com

Thanks so Much!

Jim
 
I now have windows xp and access 2003, the bypass key method used to work and now it doesn't. Has something changed from access or windows that I need to accomodate for?
 
there were some coding issues with access97 modules which meant they didnt convert to access 2k and upwards. im not sure as to the required changes as my company has not upgraded yet (?)
but it is in the pipeline and i envisage a lot of conversion work in the near future.

Be ALERT - Your country needs Lerts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top