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!

Securing my database 1

Status
Not open for further replies.

ngoz1

Programmer
Apr 19, 2002
19
0
0
GB
Hi,
The database i am building is going to be used by 3 to 4 staff and so is only going to be loaded on a single machine.

Id like to secure the database so that only i, have access to the design views of the tables, forms etc. i understand that i have to set permissions, but how do i set it so that when the database is loaded the system knows it is a staff accessing it and not me
 
When you use a secure access database:
1) your users have to join to the same workgroup (or identical workgroups [a practice I wouldn't recommend]).
2) users are prompted with a login screen that requires their username and asks for a password (if one is specified for that user).

The security wizard (if you're using A2K) should do a pretty good job walking you through the process.

search Access help for

Startup command-line options

and you can learn how to make a desktop shortcut for your users that will automatically join the correct workgroup, and can also supply their username.
 
ngoz,

Get the Access Security FAQ and read it four times. Really. It's dense, but it's really the best way to learn about Access security. There's a copy on my website, or you can get it from MS.

Also, your users don't actually have to join any particular workgroup (which can cause lots of pain). It'sw far better to leave all users joined to the default wrokgroup and start your databases either with a shortcut or (far better) a batch file. In the shortcut or batch file, you can specify which workgroup to use. For info on that, check out my Deploying Databases article, also on my website.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
I totally agree about reading the FAQ.

Regarding joining workgroups:

1) you can create desktop shortcuts to join a particular workgroup as part of invoking the database.

2) Depending on what your users do with Access (e.g. do they do their own hacking, do they use other Access Apps), it may be inappropriate to make a secure workgroup for any given application the default workgroup.
 
Hi; Im not sure what you are looking for, however I am a power user and I create lots of databases that I want no one to be able to change anything.

here is what I do

create a form witha text box, format it as a password,

Action on chandge have a macro or code open a security form if the password matches what you choose.

if the password = the password of the administrator have a security form open. Place to button on this form, Secure the database and open the database.

and place the following code.


'Secure the database'
Private Sub Command1_Click()

ChangeProperty "StartupForm", dbText, "MainMenu"
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE Security SET Security.Status = 'ON'"
DoCmd.SetWarnings True
MsgBox "You must now EXIT and RE-OPEN the database !!", vbExclamation
DoCmd.Quit
End Sub


and

'Open the database
Private Sub Command5_Click()
ChangeProperty "StartupForm", dbText, "MainMenu"
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE Security SET Security.Status = 'OFF'"
DoCmd.SetWarnings True

MsgBox "You must now EXIT and RE-OPEN the database !!", vbExclamation
DoCmd.Quit
End Sub



This should give you some help. If you need to see an example let me know.

Hoe this helps!

Jason
 
I very strongly recommend that you not use a roll-your-own form of security. It will never be as secure as what you can do with microsoft's built in security, unless you spend a huge amount of time on it, it will have far fewer features, and you will have to do without the huge number of other developers who can answer questions about built in security.

All of those properties can be set using similar code that is only available to people who are members of your custom administrators group.

The methods needed to do this are all explined in the FAQ.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top