By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,154 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,154 IT Pros & Developers. It's quick & easy.

how to gather all names of 500 tables in one table automatically

P: 47
i have an access file (database) contains 500 tables
I want to gather the names of the 500 table in one table(index table) or in one text file automatically
How can i make this?
thank you
Dec 24 '07 #1
Share this Question
Share on Google+
2 Replies


missinglinq
Expert 2.5K+
P: 3,532
How about a query?

Goto Queries in the Object Dialog box

Select Create a Query in Design View

Close the "Show Table" box

Goto View and click on SQL View

Paste this code in

Expand|Select|Wrap|Line Numbers
  1. SELECT [Name] FROM MSysObjects WHERE [Name] Not Like '~*' AND [Name] Not Like 'MSys*' AND [Type]=1; 
Welcome to TheScripts!

Linq ;0)>
Dec 24 '07 #2

ADezii
Expert 5K+
P: 8,638
i have an access file (database) contains 500 tables
I want to gather the names of the 500 table in one table(index table) or in one text file automatically
How can i make this?
thank you
If you want all the Table Names in a Text File:
Expand|Select|Wrap|Line Numbers
  1. Dim tdf As TableDef
  2.  
  3. Open "C:\MyTables.txt" For Output As #1
  4.  
  5. For Each tdf In CurrentDb.TableDefs
  6.   If Left$(tdf.Name, 4) <> "MSys" And Left$(tdf.Name, 1) <> "~" Then
  7.     Print #1, tdf.Name
  8.   End If
  9. Next
  10.  
  11. Close #1
Dec 24 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.