![]() |
|
|
| Subject:
Retrieve list of table names from Access database
Category: Computers > Programming Asked by: chris572-ga List Price: $3.00 |
Posted:
27 May 2003 11:38 PDT
Expires: 26 Jun 2003 11:38 PDT Question ID: 209433 |
I need to retreive a list of tables from an access database. I want to do so via ADO using a SQL query. For example, I have an access database with tables: cat, dog, chris, bob. I want to perform an SQL query on this database that will return these values: cat, dog, chris, bob. I have tried using SELECT * FROM MSysObjects WHERE Type = 1 AND Name Not Like "MSys*" but this does not work because read permission is denied. How can this problem be solved? | |
| |
| |
|
|
| Subject:
Re: Retrieve list of table names from Access database
Answered By: hammer-ga on 03 Jun 2003 05:09 PDT Rated: ![]() |
I'm glad the information I provided solved your problem. Here is the link again. MSDN - Listing the Tables in an Access Database http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrlistingtablesinaccessdatabase.asp Search Strategy: site:msdn.microsoft.com listing tables Access - Hammer |
chris572-ga
rated this answer:
|
|
| Subject:
Re: Retrieve list of table names from Access database
From: joelpt-ga on 27 May 2003 19:26 PDT |
This is what you need to do:
1. Open your Access db
2. Go to Tools->Options and check the boxes to show hidden and system objects.
3. Go to Tools->Security->User & Group Permissions
4. Pick MSysObjects from the list
5. Check "Read Data" permission
That should do it.
This is my test code, run from an ASP page:
----
<%
Set dbh = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
dbh.Open "DSN=AccessTest"
sql = "SELECT * FROM MSysObjects WHERE Type = 1"
rst.Open sql, dbh
do until rst.eof
response.write rst("Name") & "<BR>"
rst.movenext
loop
%>
----
~ Joel |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |