Click to See Complete Forum and Search --> : [Resolved] Hide access tables
whiteWay
Jul 20th, 2005, 06:27 PM
Does anyone know how to hide an access table via code (Table attributes set to hidden)? And then subsequently not show hidden objects (Tools-options-view-hidden objects)?
Thanks,
RobDog888
Jul 20th, 2005, 11:25 PM
I looked into your question and discovered a solution. Its quite cool too! :D
Hide Access Object (http://www.vbforums.com/showthread.php?t=350669)
Gangsta Yoda http://www.vbforums.com/attachment.php?attachmentid=38679
dee-u
Jul 20th, 2005, 11:58 PM
Never tried it yet but wow, thats a great snippet Gansta!
And may I ask its equivalent code if VB6.0? :)
RobDog888
Jul 21st, 2005, 12:10 AM
Its the same thing except you need to instanciate a Access.Application object either early bound or late bound. Instead of using
the actual "Application" code you would switch it with you instanciated Application variable object. ;)
Besoup
Jul 21st, 2005, 06:45 AM
very useful... good job man.
RobDog888
Jul 21st, 2005, 12:03 PM
Thats for the props Besoup :D Its always nice to hear positive feedback. :D
This was so interesting when I found it. When you manually right click and show Options for a table and select Hidden, that
hidden is actually not really hidden if Access is set to display hidden objects. The table would appear ghosted but visible and
my code actually completely hides it.
Maybe I should add some more description to the CodeBank code explaining this?
Besoup
Jul 21st, 2005, 02:32 PM
I haven't had time to try this out but does this keep them hidden even after you close and reopen the DB?
RobDog888
Jul 21st, 2005, 02:52 PM
I replied in the CodeBank thread since it would be good for others not in this thread to know ;)
Besoup
Jul 21st, 2005, 06:03 PM
Good deal. Now the question is how to take over exclusive rights on a DB that is already open? :P
RobDog888
Jul 21st, 2005, 06:13 PM
Why do you need to do that? If its opened Exclusive then attempting anything on it would possibly corrupt the DB.
whiteWay
Jul 21st, 2005, 06:17 PM
Thanks, the code works like a charm.
What I found interesting in problem was that I had originally hidden these tables manually. I figured that these tables would stay hidden.
However when I touched one of these hidden tables (imported data into), they became unhidden....strange.
RW
RobDog888
Jul 21st, 2005, 06:24 PM
How did you import the data? It must be updating some table properties after saving the changes from the import and not maintaining the Attribute.
Besoup
Jul 21st, 2005, 06:26 PM
Why do you need to do that? If its opened Exclusive then attempting anything on it would possibly corrupt the DB.
I got a app that runs as a scheduled task, that runs a bit of code in a few of my DB's. If one is open I get an error and it won't run because it is opened exclusively.
whiteWay
Jul 21st, 2005, 06:30 PM
I imported the data directly from an excel worksheet using the spreadsheet import command.
The excel data is formatted like a table and directly imports into a temporary Access table with the same fields. I clean the temp table up and append to a Master table. I do not change any attribute or property information.
RobDog888
Jul 21st, 2005, 06:30 PM
You can test for Exclusivitity (is that a word?) by trying to connect to it using ADO and passing the Exclusive parameter.
If its Ex then you can "try" to close it by terminating the process that has it open but you would probably need Admin rights to it. ;)
Besoup
Jul 21st, 2005, 06:33 PM
You can test for Exclusivitity (is that a word?) by trying to connect to it using ADO and passing the Exclusive parameter.
If its Ex then you can "try" to close it by terminating the process that has it open but you would probably need Admin rights to it. ;)
Cool, I will try that tomorrow when I am there... I R Admin ;)
dee-u
Jul 21st, 2005, 08:04 PM
You can test for Exclusivitity (is that a word?) ...
Maybe it would be Exclusivity only. :)
And may I further ask, if the table is hidden by your snippet, could I still use it in VB? Like query it using "SELECT * FROM HiddenTable"? I have not tried using it though.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.