As mentioned in the similar question here, to get around the
Record(s) cannot be read; no read permission on 'MSysQueries'.
error you need to GRANT SELECT privileges to the default user "Admin" with the command
GRANT SELECT ON MSysQueries TO Admin
You can execute that SQL statement from a .NET OleDbConnection, but in order to do so you need to specify the location of the default Workgroup Information File (System.mdw) in your connection string like this:
myConnectionString =
@"Provider=Microsoft.ACE.OLEDB.12.0;" +
@"Data Source=C:\Users\Public\Database1.accdb;" +
@"Jet OLEDB:System database=C:\Users\Gord\AppData\Roaming\Microsoft\Access\System.mdw;";
That path to the .mdw file can be retrieved from the Windows registry by reading the value
Key:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Access Connectivity Engine\Engines
Value:
SystemDB
(The value 14.0
in the above key is for Access 2010. Other versions of Access will have different values.)