Michael,
I did not go into the gory details of our complete security process, but we are using the one-step security wizard to allow the "admin" default user access to only run/view the database objects. When I create the database, I am using a "SuperAdmin" user as the owner and eliminating the "Admin" user from the Admin Group. Then we are creating an .MDE file that is compiled to keep people from viewing the code, reports, and forms. When I set the user environment during startup, I also have a line of code that sets the Hide Objects checkbox value to false.
Although I know that experienced Access users can overcome the "Hide Objects" process, just as easily as they can overcome the "ByPassKey" to prevent the autorun macro from starting, my boss likes the fact that for 95% of our users, they will not see any tables or queries if they try to import them to a new database. Since the database is being shipped as an .MDE, the forms, reports, and code modules are all 'grayed' out and do not allow an import as well.
I have created custom menus and toolbars that do not allow the user entry into the "Tools" area when they run our program, so it will take an experienced user to even understand where to try and get past our security. So mainly all I am looking for is a quick way to set the properties of all the tables and queries to 'hidden' so while creating the new databases I don't have to manually set each one, or type all the names of each table and query in my module.
I have the code for the TableDef, but am still working on the QueryDef. Here is what I have so far:
Function ShowTablesQueries()
Dim AllTables As TableDef
For Each AllTables In CurrentDb.TableDefs
If Not AllTables.Attributes Mod 2 = 0 Then
On Error Resume Next
AllTables.Attributes = AllTables.Attributes - dbHiddenObject
On Error GoTo 0
End If
Next AllTables
End Function
QueryDefs has a different set of attributes, so I can't use the same code for them, but I am working on it.
Thanks for everyone's assistance.
Bryan Meek
bmeek@pacbell.net
A TC in your corner gives you the personal attention you need to find the right technology solutions for your business.