gordthompson / sqlalchemy-access

A Microsoft Access dialect for SQLAlchemy.
MIT License
50 stars 9 forks source link

no read permission on 'msysobjects' #2

Closed gordthompson closed 5 years ago

gordthompson commented 5 years ago

We currently try to get table metadata by querying the MSysObjects system table, but that will often fail because the default user (admin) does not have read permissions. The workaround is to open the database in Access, go into the VBA IDE, and run a GRANT statement in the Immediate window as described here, but that's rather fussy and would have to be done for every affected database file.

As discussed on Bitbucket, a better approach would be to use the tables and columns methods of the pyodbc Cursor object, which use standard ODBC calls to retrieve that information.