ms access - Trying to read data out of MSysObjects with ODbc in C#, but getting no permission error -


as described in title: trying read out data msysobjects in access 2010 database, exception telling me not allowed read table.

i can read out of other non-msys tables.

sql query using: select * msysobjects type=1 , flags=0 

connection string:

driver={microsoft access driver (*.mdb, *.accdb)};dbq=c:\mydatabase.accdb;uid=admin;pwd=; 

this standard connection sting seen on http://www.connectionstrings.com/access/

how can access read msysobjects ?

since db accdb format, means db engine sees admin user runs queries. , admin not have read (select) permission msysobjects.

execute ddl grant statement give admin permission.

grant select on msysobjects admin; 

i'm not statement can executed odbc connection. if fails, open db in access application session , run there.

currentproject.connection.execute "grant select on msysobjects admin;" 

note statement must executed ado. currentproject.connection ado object, execute method can run statement successfully. if try use dao-based method, such currentdb.execute or run statement query in query designer, fail error 3129, "invalid sql statement; expected 'delete', 'insert', 'procedure', 'select', or 'update'."

alternatively, should work c# if run oledb connection access db.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -