PC Review


Reply
Thread Tools Rate Thread

How can I get a listing of all tables in Access

 
 
=?Utf-8?B?ZGM=?=
Guest
Posts: n/a
 
      3rd Nov 2004
I am trying to list all the table names in a Access 2002 database and
subsequently run a query against a subset of the tables. Is there a way to
list the tables to file?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2lt?=
Guest
Posts: n/a
 
      3rd Nov 2004
This will give you a recordset of the tables

strSql = "Select Name from MSysObjects "
strSql = strSql & "WHERE (((IIf(Left([Name],4)='Msys',0,1))=1) AND
((Type)=1));"

Set rs = CurrentDB.OpenRecordset(strSql)


"dc" wrote:

> I am trying to list all the table names in a Access 2002 database and
> subsequently run a query against a subset of the tables. Is there a way to
> list the tables to file?

 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      3rd Nov 2004
You can get a listing of tables with a simple query:

SELECT Name
FROM msysobjects
WHERE Name Not Like "Msys*" AND Type=1 Or Type)=6;

MSysObjects is a hidden table in Access that keeps track of all the objects
in the Database Window (tables, forms, reports, etc). Type 1 are native
tables. Type 6 are linked tables. The SQL above also assumes you don't
want to see the other "system" tables in your list, so excludes anything
starting with MSys.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"dc" <(E-Mail Removed)> wrote in message
news:E3BDB648-EC59-4620-8EA9-(E-Mail Removed)...
> I am trying to list all the table names in a Access 2002 database and
> subsequently run a query against a subset of the tables. Is there a way to
> list the tables to file?



 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      3rd Nov 2004
Sorry in my haste to clean up the query, I missed a paren:

SELECT Name
FROM msysobjects
WHERE Name Not Like "Msys*" AND Type=1 Or Type=6;

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Roger Carlson" <NO-Rog3erc-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You can get a listing of tables with a simple query:
>
> SELECT Name
> FROM msysobjects
> WHERE Name Not Like "Msys*" AND Type=1 Or Type)=6;
>
> MSysObjects is a hidden table in Access that keeps track of all the

objects
> in the Database Window (tables, forms, reports, etc). Type 1 are native
> tables. Type 6 are linked tables. The SQL above also assumes you don't
> want to see the other "system" tables in your list, so excludes anything
> starting with MSys.
>
> --
> --Roger Carlson
> Access Database Samples: www.rogersaccesslibrary.com
> Want answers to your Access questions in your Email?
> Free subscription:
> http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L
>
> "dc" <(E-Mail Removed)> wrote in message
> news:E3BDB648-EC59-4620-8EA9-(E-Mail Removed)...
> > I am trying to list all the table names in a Access 2002 database and
> > subsequently run a query against a subset of the tables. Is there a way

to
> > list the tables to file?

>
>



 
Reply With Quote
 
hero
Guest
Posts: n/a
 
      4th Nov 2004
ee
dc <(E-Mail Removed)> wrote in message
news:E3BDB648-EC59-4620-8EA9-(E-Mail Removed)...
> I am trying to list all the table names in a Access 2002 database and
> subsequently run a query against a subset of the tables. Is there a way to
> list the tables to file?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a listing from multiple tables in Access 2007 Bob H Microsoft Access Database Table Design 3 30th Nov 2008 09:32 PM
Listing hidden tables Nando Microsoft Access VBA Modules 1 17th Jul 2008 06:51 AM
Listing tables from different DB Del Microsoft Access VBA Modules 1 9th Jul 2008 01:09 AM
Re: Listing all the tables in MS access Databsae using ODBC Val Mazur Microsoft ADO .NET 5 15th May 2004 03:49 AM
Listing tables of database AnandVishy Microsoft C# .NET 1 5th Dec 2003 12:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:29 PM.