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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Code Help-- Setting Password Protection

Status
Not open for further replies.

jprochelle

Technical User
Jun 18, 2004
36
0
0
US
I'm trying to write code so that holding shift to open the database requires a password, and/or a macro so that when the database is opened as normal-there is a command button that will open it in "edit"/database admin view, which requires the same password.

Basically, I want the users to only be able to use the database and do nothing else to it. (the only changes users can make is importing data to a table -which is done via a form with a macro to autoimport)

How would I go about doing this?
 
Take a look at MDE

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This is almost impossible to do. But there are a few "tricks" you can use to minimize the chance that users' will turn the application into a playground.

First, only distribute the mde version of your application. In the mde version all of the VBA code is compiled and there is no source code, so users' can't change forms, reports, etc.

Second, set up your own login form that will open when users' start the application. Store the userid and rights in public variables (define these in a module in the database). On your main form and perhaps one or more of the primary forms that people would use (and would be tempted to mess around with) include code that says when the form is loaded (onLoad property) if the userid variable is null (or, perhaps, even the rights variable is null if you want to go further) immediately quit the application. So when your hotshot users try to do their thing and open one of these forms they will be thrown out of the application.

All of that said, the back end is much harder to protect. The best protection is to use a SQL Server (or similar enterprise level database manager) for your data, rather than Access.

For any protection you include, be sure you don't lock yourself out of the database. You need to be able to get in to the database so you can make updates, etc., to it. Basically, you must always keep the mdb file where you can use it, and you must be able to "get around" anything you set up so the shift key start is defeated.

One other thing is to only have the application front end on a server and periodically copy the "basic" version of the front end (which should not contain any user entered data) over the version on the server. So if the hotshots try to get funny, their efforts are effectivly erased.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top