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

Hiding all database objects

Status
Not open for further replies.

pjtarheel

Technical User
Jan 14, 2005
14
US
I'm looking for an easy way to hide all the objects in a database without having to do each one individualy through their properties menu. I found an earlier post which suggested the following code:

dim frm as object
for each frm in currentproject.allforms
application.sethiddenattribute acform,frm.name,true
next frm

I tried this and it worked great for the forms, reports and macros. But I can't get it to work on the tables or queries. Here is what I have for these:

Dim tbl As Object
For Each tbl In CurrentProject.AllTables
Application.SetHiddenAttribute acTable, tbl.Name, True
Next tbl

and

Dim qry As Object
For Each qry In CurrentProject.AllQueries
Application.SetHiddenAttribute acQuery, qry.Name, True
Next qry

Can anyone tell me why this won't work for the tables and queries, and hopefully also tell me how to get it to work?

Thanks!

Paul
 
Why not go to Tools-Startup and click the hide database window option and any other options you don't want to see when the app opens.

Note, make sure to make a backup of your database first. If you limit startup options, you may lock yourself out.

If this happens you can sometimes click F11 to see the database window or hold down Shift-Enter when opening the app and it will open in design mode.

Hope this helps.
 
Well, I'm trying to encourage other users to use forms for data access and not go at the tables and such directly. I do have the database window hidden on startup, but that hasn't been enough. I eventually want to secure the database and set up rights in that way, but for now I am just looking to at least add a few steps in between the user and the database objects.

I really do need to set up permissions and such. But I've never set up a secure database and it looks a little intimidating (especially having so little free time right now to get into it).

Thanks!

Paul
 
Paul,

What I have done is split the database into front and back end. Apply security. Copy the front end. Hide objects as cghoga suggests. Disable the shift key on startup. Holding the shift key on start up makes the database window visible again. Then the database is pretty much locked up. I have read there are still ways to get in but with the level of users I work with, it will never happen. I can distribute this version to users while maintaing the unlocked version for further development.

Best regards,

Henry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top