What is the VBA syntax for accessing hidden tables in MS-Access?

I want to create a list of all tables in ms Access database, including hidden ones.

+3
source share
2 answers

The following will display the name of each table in the nearest window.

Sub ShowAllTables()

    Dim obj As AccessObject

    For Each obj In Application.CurrentData.AllTables
            Debug.Print obj.Name
    Next obj

End Sub
+2
source

I don't know if AccessObject can tell you if the table is hidden, but ADO certainly can, for example,

Sub ShowAllTables2()

  Dim cat
  Set cat = CreateObject("ADOX.Catalog")

  With cat
    .ActiveConnection = CurrentProject.Connection

    Dim t
    For Each t In .tables
      Debug.Print t.Name, t.Properties("Jet OLEDB:Table Hidden In Access").Value
    Next

  End With

End Sub
+1
source

Source: https://habr.com/ru/post/1708782/


All Articles