Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Finding a list of tables in Access from VBA in Excel

I am trying to get a list of tables from Access in an Excel VBA program that
I'm writing. I have the query set up in Access that specifies this statement:
SELECT msysobjects.Name, msysobjects.Type
FROM msysobjects
WHERE (((msysobjects.Name) Not Like 'msys*') AND ((msysobjects.Type)=1 Or
(msysobjects.Type)=6));
It works from within Access, but when I ask Excel to use ADO and run "Select
* from [<Name of Query]", I get an access denied error message. The
connection is using the "Admin" user information, and yet I get the access
denied message. I need to know if there is something within ADO that is
blocking the connection or is it a limited amount of access to the
MSysobjects outside of the Access program, and if possible a way to correct
the problem.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Finding a list of tables in Access from VBA in Excel

I would expect some sort of access restriction on Access objects, but not
sure if they are actually blocked.
Are they visible in Access ? I would assume if they are hidden, they would
not available.

ADO has the OpenSchema method for this.

NickHK

"ToDieFor" wrote in message
...
I am trying to get a list of tables from Access in an Excel VBA program

that
I'm writing. I have the query set up in Access that specifies this

statement:
SELECT msysobjects.Name, msysobjects.Type
FROM msysobjects
WHERE (((msysobjects.Name) Not Like 'msys*') AND ((msysobjects.Type)=1 Or
(msysobjects.Type)=6));
It works from within Access, but when I ask Excel to use ADO and run

"Select
* from [<Name of Query]", I get an access denied error message. The
connection is using the "Admin" user information, and yet I get the access
denied message. I need to know if there is something within ADO that is
blocking the connection or is it a limited amount of access to the
MSysobjects outside of the Access program, and if possible a way to

correct
the problem.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Finding a list of tables in Access from VBA in Excel

Where would I find the OpenSchema method? Is that in the .NET framework that
you are referring to? I am using Microsoft Excel to write the program / VBA
application. This uses the syntax from VB 6. When I play with the options
available, I find one that closes the recordset as soon as the command is
executed. Is there another way to get a list of tables and queries from
Access without using the sql statement that I came up with?

"NickHK" wrote:

I would expect some sort of access restriction on Access objects, but not
sure if they are actually blocked.
Are they visible in Access ? I would assume if they are hidden, they would
not available.

ADO has the OpenSchema method for this.

NickHK

"ToDieFor" wrote in message
...
I am trying to get a list of tables from Access in an Excel VBA program

that
I'm writing. I have the query set up in Access that specifies this

statement:
SELECT msysobjects.Name, msysobjects.Type
FROM msysobjects
WHERE (((msysobjects.Name) Not Like 'msys*') AND ((msysobjects.Type)=1 Or
(msysobjects.Type)=6));
It works from within Access, but when I ask Excel to use ADO and run

"Select
* from [<Name of Query]", I get an access denied error message. The
connection is using the "Admin" user information, and yet I get the access
denied message. I need to know if there is something within ADO that is
blocking the connection or is it a limited amount of access to the
MSysobjects outside of the Access program, and if possible a way to

correct
the problem.




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
Close Excel tables from Access StacyM Excel Discussion (Misc queries) 0 August 11th 09 09:04 PM
Connecting Excel sheets to Access Tables??? Dave Excel Discussion (Misc queries) 1 January 9th 09 11:44 PM
How to update ms access tables directly from ms excel? Nabin New Users to Excel 3 October 11th 06 01:48 PM
Access tables in Excel widman Excel Discussion (Misc queries) 0 March 7th 06 08:26 PM
Excel to Access linked tables Keith Excel Discussion (Misc queries) 0 December 14th 05 10:37 PM


All times are GMT +1. The time now is 01:42 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"