30. juli 2002 - 08:30Der er
34 kommentarer og 2 løsninger
Hvordan sætter man sikkerhed på en database?
Nu har jeg prøvet frem og tilbage og læst en del men kan bare ikke finde ud af at sætte sikkerhed på databasen. Eller jo hvis alle bruger den samme workgroup file. Men det er jo ikke meningen.
Inden jeg holdte sommerferie mener jeg at jeg fik det til at virke som det skulle. Men nu virker det ikke. Jeg er lost.
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
1. Create a new workgroup using the Workgroup Admin. Tool. (C:\WINNT\system32\WRKGADM.EXE) 2. Open Access, signing on as Admin user. 3. Open the database you want to secure. 4. Add a new admin user. Use for example: Application Name + Admins 5. Add the Admins group to the new Admin user. 6. Change the Admin password. 7. Change User Group permissions to be No Run/Open, No Open Exclusive, and No Administrator on the database object. 8. Close Access. 9. Reopen Access, this time sign on as the new Admin user. 10. Open the database you are securing. 11. Run the security wizard on the database. Making sure that you select all objects in the first dialog box. 12. When the wizard has finished, close Access again. 13. Reopen Access, this time sign on as the new Admin user. 14. Open the database you are securing. 15. Remove the Admins group for the Admin user. This action ensures that any user who opens that database without using the correct workgroup file can’t see any of the database objects. 16. Add the groups that will be required for the database. 17. Add all users to their correct groups. 18. Assign permissions to the groups as required. 19. As new objects are added, add or remove the permissions as required.
This workgroup file (system.mdw) must accompany your database. To start your database using this workgroup file and not the default you must use a shortcut to open your database.
the shortcut should look something like this "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /wrkgrp "D:\SomePath\system.mdw" "D:\SomePath\YourSecureDB.mdb"
Terry... if i do as you say. And someone opens the database without the workgroup file that i made. Does this then prevent them from opening it or what?
The system.mdw you referer to is this the workgroup file i just made in step 1?
If i do as you say, and open the database with the shortcut. Does everyone then log in automatically? Or what?
I need to be able to open the database without entering any username or password where the only thing you can is read everything and be able to add, delete, update a table.
Is there a way to prevent users from opening the window where you can view, create and delete tables, forms, queries, reports, and so on.
Yes if they do NOThave the workgroupp file then they can NOT open it. Yes (step 1). No they will be prompted for a password!
You can open the database using a shortcut AND including the user name and password but there is NOT much security in this method.
You can make an MDE file and hide the database window and perhaps remove standard menu's but it is still possible to open the dB by holding the shift key when opening the dB. There are ways to remove this though.
Terry ... I need to let the program log in automatic or use the shortcut to do that, because this program will be send out to thousands of users and they all should have the possibility to use the program without entering username and password.
How should the shortcut look like if it should use a username and password and include the workgroupfile? :)
If your program is to be used by 1000's of users then I HOPE you are NOT using Access as the backend (data) database?
Access has a maximum (theoretical) 255 users!
So IF you are using for example MS SQL Server then it would be an idea to use SQL Server/NT security for logging on.
If you have MS Office Developer then you can make a setup-kit which will include a runtime version of Access. This saves you having to have a license for ALL users. It also makse it possible to secure your database better. When using the runtime it isnt possible to open the dB and alter the DESIGN.
IF you are just trying to stop them from altering the design then forget using Access security and make a setup-kit as I suggest here!
All customers get the database each. Not a single database for all users. I dont have MS Office Developer so i cant make use of the runtime version of access.
OK, I suggest that you FORGET Access security! You should distribute an MDE file and NOT an MDB file. This stops anyone going into any VBA code.
You can HIDE the database window in the setup options menu. and you can also make your own menu and use this instead of the standard menu. Then make a shortcut similar to the one I mention but remove the workgroup part. Now add a paramater
/runtime
This starts Access in RUNTIME mode and by doing this stops people playing around. They can STILL open the dB directly if they know how, but you can use the method in the link I sent to stop them using the shift key to bypass the startup.
hvorfor køber du ikke Developer ? shift tasten kan sagtens gøres ukampdygtig ! prøv at søge i ms-knowledgebase der ligger den kode lige til at nappe. ellers har terry den sikkert.
Hvis det har interesse, kan du også få password, på hvert enkelt formular. Dvs din åbningsformular, lægger du også password på. Så kan den også åbnes ved maskinskift. Vh Henrik
Terry ... I meant i got the vba code to disable the shift key. But doesnt know how to run it at startup. You told me to run it in autoexec. But how can autoexec run the code to disable shift if i hold the shift key down while opening the database?
Sub SetStartupProperties() Const DB_Text As Long = 10 Const DB_Boolean As Long = 1 ChangeProperty "StartupForm", DB_Text, "Customers" ChangeProperty "StartupShowDBWindow", DB_Boolean, False ChangeProperty "StartupShowStatusBar", DB_Boolean, False ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False ChangeProperty "AllowFullMenus", DB_Boolean, True ChangeProperty "AllowBreakIntoCode", DB_Boolean, False ChangeProperty "AllowSpecialKeys", DB_Boolean, False ChangeProperty "AllowBypassKey", DB_Boolean, False End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer Dim dbs As Object, prp As Variant Const conPropNotFoundError = 3270
Set dbs = CurrentDb On Error GoTo Change_Err dbs.Properties(strPropName) = varPropValue ChangeProperty = True
Change_Bye: Exit Function
Change_Err: If Err = conPropNotFoundError Then ' Property not found. Set prp = dbs.CreateProperty(strPropName, _ varPropType, varPropValue) dbs.Properties.Append prp Resume Next Else ' Unknown error. ChangeProperty = False Resume Change_Bye End If End Function
This is taken from Access (97)Help Create a custom menu bar for the current database
1 On the View menu, point to Toolbars, and then click Customize. 2 On the Toolbars tab, click New. 3 In the Toolbar Name box, type the name you want, and then click OK. 4 On the Toolbars tab, click Properties. 5 In the Type list, click Menu Bar. 6 Set any other properties you want, and then click Close.
The new menu bar is now behind the Customize dialog box. To see the new menu bar, move the Customize dialog box to the side, and then proceed to step 7.
7 To complete the menu bar, do the following:
· Add custom menus. For more information, click . · Add a built-in menu. For more information, click .
Notes
· Microsoft Access still supports menu bar macros for applications created with a prior version of Microsoft Access. For more information, click . · You can attach the custom menu bar to a form or report. For more information, click . Or, you can designate the bar as the global menu bar. For more information, click .
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.