With GetSchema, I get all Access objects. How can I understand if the table is hidden?

This is a custom hidden table.

  • What version of MS Access are we talking about? - nzeemin
  • The files are in .mdb format, ie 2003, but for opening I use Access 2010+ - iluxa1810
  • Once upon a time I wrote the BatchAccess utility - rsdn.ru/article/files/progs/BatchAccess.xml - it works through the Jet driver, but I haven’t studied how it fits with the new office versions. In any case, the source code is there. In theory, the utility can pull out the entire structure of the database in the form of SQL. - nzeemin

2 answers 2

The MSysObjects system table stores a list of MS Access database objects, including and tables. In the MSysObjects table there is a Flags field. If the table has the attribute "Hidden", then the value in the Flags field = "8". Accordingly, you can specify the necessary search criteria in the query condition: SELECT [Name] FROM [MSysObjects] WHERE [Type]=1 AND [Flags]=8 .

  • [Type] = 1 - selection of "native" tables (if linked, then "6")
  • [Flags] = 8 - have the attribute "hidden"
  • Does a custom visible table have Flags = 0? Type = 1 and Flags = 0 will I get all visible user tables excluding the rest of the garbage? - iluxa1810
  • Yes, the user visible table is indicated in the MSysObjects table in the Flags field as = 0. Those. query: SELECT [Name] FROM MSysObjects WHERE Type = 1 AND Flags = 0 You get all the visible user tables, excluding the rest of the "garbage". - M. Stan.
  • When requesting a sample, swears that rights are missing ... - iluxa1810

Tested my old tools. Both BatchAccess and .batchAccessGUI work with .mdb made in Access 2013. And the good news for you is through ADOX, you can get table properties, among which is “Jet OLEDB: Table Hidden In Access”.

BatchAccess GUI hidden table

To work with ADOX, we connect "Microsoft ADO Ext. 2.8 for DDL and Security", then:

 ADOX.Catalog adoxCatalog = new ADOX.CatalogClass(); adoxCatalog.Create(AConnectionString); ADOX.Table adoxTable = adoxCatalog.Tables[tablename] 

Then in the table's Properties collection find the desired property by name and take its value.

  • Eh ... I did not want to use the COM library, but apparently there is no other choice- ( - iluxa1810