title: Grant read permission for MSysObjects
body: <p>I need to get the metadata of some hundred MS Access DBs, so I need to automate the process of metadata gathering.
  I want to query stuff described <a href="http://access.mvps.org/access/queries/qry0002.htm" rel="nofollow noreferrer">here</a>, but before I can query the DBs I need read access to <code>MSysObjects</code> tables.</p>
  
  <p>I Keep getting following error: </p>
  
  <blockquote>
    <p>Record(s) cannot be read; no read permission on 'MsysObjects'.</p>
  </blockquote>
  
  <p>so I dug deeper:</p>
  
  <p>I've read the article about similar issues in the C# section (<a href="https://stackoverflow.com/questions/21235430/no-read-permission-on-msysobject-error">see here</a> and also <a href="https://stackoverflow.com/questions/1937703/record-cannot-be-read-no-read-permission-on-msysobjects">this one</a>).</p>
  
  <p>I put together a simple script which works well for creating tables and so on, but I am having problems to setup the read access.</p>
  
  <pre><code>$ScrUsr = $(whoami)
  Write-Host $ScrUsr
  
  $cmd = "GRANT SELECT ON MSysObjects TO [$ScrUsr]"
  Write-Host $cmd
  
  Function Invoke-ADOCommand($Db)
  {
    $connection = New-Object -ComObject ADODB.Connection
    $connection.Open("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$db;" )
    $command = New-Object -ComObject ADODB.Command
    $command.ActiveConnection = $connection
    $command.CommandText = $cmd
    $rs = $command.Execute()
    $connection.Close()
  } 
  
  $Db = "C:\Temp\test1.accdb"
  
  Invoke-ADOCommand -db $Db 
  </code></pre>
  
  <p>Executing the Script throws me following Error reason:</p>
  
  <blockquote>
    <p>Cannot open the Microsoft Office Access database engine workgroup information file.</p>
  </blockquote>
  
  <p>How can I allow read permission on <code>MSysObjects</code>?</p>