Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Is there SQL access to MS-Access MSysObjects?

I am using Office 2003 on Windows XP with ADO 2.8.

When I run the following SQL against an Access DB from Excel:

sSQL = "SELECT Name FROM MSysObjects WHERE Type = -32768;"

I get an "insufficient permissions" error. The DB is simple (only one
table), was created by me, and has no security applied.

Is it not possible to query MSysObjects from Excel using ADO to get at the
object names and properties in a DB?

Is ADOX the only other alternative?

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Is there SQL access to MS-Access MSysObjects?

quartz,
If you look at the permissions/ownership of the table in Access, you will
see that most are own by "Engine".

Nick

"quartz" wrote in message
...
I am using Office 2003 on Windows XP with ADO 2.8.

When I run the following SQL against an Access DB from Excel:

sSQL = "SELECT Name FROM MSysObjects WHERE Type = -32768;"

I get an "insufficient permissions" error. The DB is simple (only one
table), was created by me, and has no security applied.

Is it not possible to query MSysObjects from Excel using ADO to get at the
object names and properties in a DB?

Is ADOX the only other alternative?

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Is there SQL access to MS-Access MSysObjects?


NickHK wrote:
When I run the following SQL against an Access DB from Excel:

sSQL = "SELECT Name FROM MSysObjects WHERE Type = -32768;"

I get an "insufficient permissions" error.


If you look at the permissions/ownership of the table in Access, you

will
see that most are own by "Engine".


Therefore, the OP could create a VIEW e.g.

CREATE VIEW OddView AS SELECT Name FROM MSysObjects WITH OWNERACCESS
OPTION;

or maybe even change the permissions e.g.

GRANT SELECT ON TABLE MSysObjects TO Developers;

Is ADOX the only other alternative?


Take a look at the ADO Connection object's OpenSchema method.
OpenSchema is generally more feature rich than ADOX (which itself uses
OpenSchema under the hood) but ADOX is required for missing information
from or bugs in OpenSchema methods e.g. the Autoincrement property for
a column springs to mind.

Jamie.

--

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Is there SQL access to MS-Access MSysObjects?

Thanks to both of you...

"Jamie Collins" wrote:


NickHK wrote:
When I run the following SQL against an Access DB from Excel:

sSQL = "SELECT Name FROM MSysObjects WHERE Type = -32768;"

I get an "insufficient permissions" error.


If you look at the permissions/ownership of the table in Access, you

will
see that most are own by "Engine".


Therefore, the OP could create a VIEW e.g.

CREATE VIEW OddView AS SELECT Name FROM MSysObjects WITH OWNERACCESS
OPTION;

or maybe even change the permissions e.g.

GRANT SELECT ON TABLE MSysObjects TO Developers;

Is ADOX the only other alternative?


Take a look at the ADO Connection object's OpenSchema method.
OpenSchema is generally more feature rich than ADOX (which itself uses
OpenSchema under the hood) but ADOX is required for missing information
from or bugs in OpenSchema methods e.g. the Autoincrement property for
a column springs to mind.

Jamie.

--


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query from Access into Excel cause Access to go to read only T Stephens Excel Discussion (Misc queries) 0 March 24th 09 04:17 PM
Can Excel access data from Access?! Al Excel Discussion (Misc queries) 5 April 5th 08 03:52 PM
Access Form In An Access Report (SubForm) Question Gary Links and Linking in Excel 0 January 27th 06 05:54 AM
Access data -work in Excel- save in Access s_u_resh Excel Programming 1 October 25th 04 12:52 PM
Getting Access Error Messages when running Access through Excel Dkline[_2_] Excel Programming 0 October 12th 04 09:35 PM


All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"