Sunteți pe pagina 1din 2

Security Demo: Originally designed by Richard Rensal, I took this DB and made some modification s to it.

With this database it is a simple task to add security levels to an existing DB through VBA code. TO do this import all of your existing DB components into the security DB, and on each of your forms set up in the OnOpen event something like this: ############################################################################ Private Sub Form_Open(Cancel As Integer) On Error GoTo Err_Form_Open If User.AccessID = 1 Then 'Here list all buttons that should be anabled for Admin only Me.cmdAdmin.Enabled = True Else Me.cmdAdmin.Enabled = False End If If User.AccessID = >1 Then 'Here list all buttons that should be enabled for level 2 only Me.cmdbutton.Enabled = True Else Me.cmdbutton.Enabled = False End If Exit_Form_Open: Exit Sub Err_Form_Open: MsgBox Err.Description Me.Visible = True Resume Exit_Form_Open End Sub ############################################################################ This will enable/disable buttons based on the security level for each form. You can also do the same thing based on the ViewID of a user...with this you can set edit, delete, add properties for each user. Once that is done change the splashscreen to something you like, and point it to your main menu. The Main menu in the DB is titled "fmnuMainMenu" If you change the name of your main menu to this, no additional coding will be needed to open it from the splashscreen. The Admin menu allows you change/add Access and View levels, reset a users passw ord(PW) and it will automatically e-mail it to them. If you do not have access t o E-Mail, you will have to change things around to bypass the e-mail code, and t o make sure you know what the new PW is. The new password will be a randomly gen erated 8 letter password. The next time they log on they will have to use this p assword and they will be promted for a new one. This DB uses a default table titled "tblUsers" for all people in the DB. This is in addition to "tblSecurity" which only lists the security settings for each pe

rson. The reason I seperated the two, was to be able to hide the security table, and still have access to the table of people. The first time you open the DB login as ADMIN PASSWORD from there you will be promted to change your password. After that you will have full access to add new users, and apply their security settings. I hope this can help you out!! Any questions, please PM me at UtterAccess!! Nick Phillips

S-ar putea să vă placă și