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,
Printable View
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,
I looked into your question and discovered a solution. Its quite cool too! :D
Hide Access Object
Gangsta Yoda http://www.vbforums.com/attachment.p...chmentid=38679
Never tried it yet but wow, thats a great snippet Gansta!
And may I ask its equivalent code if VB6.0? :)
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. ;)
very useful... good job man.
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?
I haven't had time to try this out but does this keep them hidden even after you close and reopen the DB?
I replied in the CodeBank thread since it would be good for others not in this thread to know ;)
Good deal. Now the question is how to take over exclusive rights on a DB that is already open? :P
Why do you need to do that? If its opened Exclusive then attempting anything on it would possibly corrupt the DB.
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
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.
Quote:
Originally Posted by RobDog888
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.
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.
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 ;)Quote:
Originally Posted by RobDog888
Maybe it would be Exclusivity only. :)Quote:
Originally Posted by RobDog888
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.