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

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


Since your db is ACCDB format, you will be working as user Admin. You can confirm that point in the Immediate window. (Go there with Ctrl+g)

? CurrentUser()Admin

Since Admin doesn't have read (SELECT) permission on MSysObjects, execute a DDL statement to give Admin that permission.

strDdl = "GRANT SELECT ON MSysObjects TO Admin;"CurrentProject.Connection.Execute strDdl


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 WithEnd Sub


Here's what worked for me, since this is the first SO question that comes up for this:

  1. this is an MDB file. Don't know about others. I understand this is not what the question asked for. However, StackOverflow questions/answers are also used by many other people arriving here via google, as I did, and I'm using MDB. I hope this answer is of use to someone else.

  2. Open MS Access GUI. Didn't figure out how to do this without it, sorry, though it's likely possible.

  3. Go to Tools...Options...

  4. Click "View" tab

  5. select "Hidden objects", "System objects"

  6. close tab

  7. Go to Tools...Security.. User and Group permissions

  8. Select all the table names including MSysObjects

  9. click all the "permissions" checkboxes so they set up as "checked" for all entries

  10. apply/OK as needed