Record cannot be read; no read permission on 'MSysObjects'

后端 未结 5 1966
春和景丽
春和景丽 2020-12-03 15:08

I\'m trying to get a list of all tables from an Access 2007 ACCDB format database using Excel VBA.

I have followed this post:

How can I get table names from

5条回答
  •  -上瘾入骨i
    2020-12-03 16:04

    Use the DAO tabledefs collection

    Sub TableDefs()
    
        Dim db As dao.Database
        Dim tdfLoop As dao.TableDef
    
        Set db = CurrentDb
        With db
            Debug.Print .TableDefs.Count & " TableDefs in " & .name
            For Each tdfLoop In .TableDefs
                Debug.Print "    " & tdfLoop.name
            Next tdfLoop
        End With
    
    End Sub
    

提交回复
热议问题