By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,376 Members | 3,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,376 IT Pros & Developers. It's quick & easy.

Hide a table

P: 16
Hello Everybody,
Im Trying to hide my tables so that they can't be imported/linked from another database.

i've searched, and searched, and i have a question that i haven't found already asked anywhere. I work for a corporation, and have self taught myself access, and VBA. we have a database where i work, and my manager would like to share our database with other groups. the only problem is that certain people aren't allowed to see some things, when other people are.

in some of my searching i have done out here i have found that even in a database that is locked out completely, you can still import all of the information by opening another database, and importing the data. i want to be able to write some kind of code that would hide the tables so that nobody is able to import that table from another database.

Does anybody have any ideas on what i would be able to do that would prevent a table from being imported, or linked from another database?

Thanks
Jul 23 '07 #1
Share this Question
Share on Google+
7 Replies


Expert 100+
P: 634
Hi
Hello Everybody,
Im Trying to hide my tables so that they can't be imported/linked from another database.

i've searched, and searched, and i have a question that i haven't found already asked anywhere. I work for a corporation, and have self taught myself access, and VBA. we have a database where i work, and my manager would like to share our database with other groups. the only problem is that certain people aren't allowed to see some things, when other people are.

in some of my searching i have done out here i have found that even in a database that is locked out completely, you can still import all of the information by opening another database, and importing the data. i want to be able to write some kind of code that would hide the tables so that nobody is able to import that table from another database.

Does anybody have any ideas on what i would be able to do that would prevent a table from being imported, or linked from another database?

Thanks
You could try looking at

CurrentDb.TableDefs("TableName").Attributes = dbHiddenObject
and, of course
CurrentDb.TableDefs("TableName").Attributes = 0
to unhide it !!


MTB
Jul 24 '07 #2

Expert 100+
P: 344
Hello Everybody,
Im Trying to hide my tables so that they can't be imported/linked from another database.

i've searched, and searched, and i have a question that i haven't found already asked anywhere. I work for a corporation, and have self taught myself access, and VBA. we have a database where i work, and my manager would like to share our database with other groups. the only problem is that certain people aren't allowed to see some things, when other people are.

in some of my searching i have done out here i have found that even in a database that is locked out completely, you can still import all of the information by opening another database, and importing the data. i want to be able to write some kind of code that would hide the tables so that nobody is able to import that table from another database.

Does anybody have any ideas on what i would be able to do that would prevent a table from being imported, or linked from another database?

Thanks
You could use the Access security system to secure your database. You could then allow different users different access rights to different tables and only those users with the correct passwords would be able to access your tables.

The Access Security system is very powerful, however, it is not intuitive and takes some effort to get it to work. When it works though, its worth the effort
Jul 24 '07 #3

ADezii
Expert 5K+
P: 8,638
Hello Everybody,
Im Trying to hide my tables so that they can't be imported/linked from another database.

i've searched, and searched, and i have a question that i haven't found already asked anywhere. I work for a corporation, and have self taught myself access, and VBA. we have a database where i work, and my manager would like to share our database with other groups. the only problem is that certain people aren't allowed to see some things, when other people are.

in some of my searching i have done out here i have found that even in a database that is locked out completely, you can still import all of the information by opening another database, and importing the data. i want to be able to write some kind of code that would hide the tables so that nobody is able to import that table from another database.

Does anybody have any ideas on what i would be able to do that would prevent a table from being imported, or linked from another database?

Thanks
  1. Lysander has the correct approach when he suggests you enable a comprehensive Security System within your Database. This would solve all your problems.
  2. If you simply want to 'Hide' certain Tables so that no one can view them, preface them with MSys as in MSysTable1. Access will interpret this Table as a System Object (Table) and not display it in the Database Window (byDefault). You could then display this Table at will via Tools ==> Options ==> View ==> System Objects. Even though Hidden, data within this Table wouold also be fully accessible.
  3. You could also set its Hidden Attribute as previously indicated via code or by selecting the Table in the DB Window ==> right clicking the Table ==> Properties ==> select Hidden. To again View the Table: Tools ==> Options ==> View ==> Hidden Objects. Again the contained data would be accessible.
Jul 24 '07 #4

Expert 100+
P: 634
You could also set its Hidden Attribute as previously indicated via code or by selecting the Table in the DB Window ==> right clicking the Table ==> Properties ==> select Hidden. To again View the Table: Tools ==> Options ==> View ==> Hidden Objects. Again the contained data would be accessible.
No, if you set the hidden attribute in CODE then even using the Hidden Checkbox on the Tool -> Option dialogue does not show these tables, although thay are accesible in code and to forms, but not available in design design view lists for forms/queries/reports, or when some tries to link/import from it.

So, only run the code to hide the table when you post/distribute the DB, after all the design id done.

If you have a FE/BE design, you can write code to hide both the FE link table and the BE table.

At least that is what I find using the code in my earlier post.

I use this for hiding user/permission/password tables etc.

However, I am not saying this is the best way, its just the way I have developed over a number of years (starting in Access 97) so things have probably changed with workgroups security?

MTB
Jul 24 '07 #5

ADezii
Expert 5K+
P: 8,638
No, if you set the hidden attribute in CODE then even using the Hidden Checkbox on the Tool -> Option dialogue does not show these tables, although thay are accesible in code and to forms, but not available in design design view lists for forms/queries/reports, or when some tries to link/import from it.

So, only run the code to hide the table when you post/distribute the DB, after all the design id done.

If you have a FE/BE design, you can write code to hide both the FE link table and the BE table.

At least that is what I find using the code in my earlier post.

I use this for hiding user/permission/password tables etc.

However, I am not saying this is the best way, its just the way I have developed over a number of years (starting in Access 97) so things have probably changed with workgroups security?

MTB
Thanks MTB for pointing this out to me. I should have specified that to again view the Table after setting its Hidden Attribute in the Table's Properties Window, blah, blah, blah. I stand corrected.
Jul 24 '07 #6

P: 16
Thank you everybody for your responses. it looks like the tabledef code is doing what i was wanting it to do

Thanks a bunch!
Jul 25 '07 #7

P: 1
I know this has been a while from the last posting, but you might try:

Application.SetHiddenAttribute acTable,"tblTableName", True
Feb 10 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.