472,371 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

Query to get all the table names in a database

Hi guys!

What query should I use to retrieve a list of all the table names in an Access database? The effect would be similar to that of a simple "SHOW TABLES;" in MySql. To clear thing up, "SHOW TABLES;" does not work in Access(it says something like: "SELECT, INSERT, UPDATE or DELETE expected").

Thanks in advance.
Mar 7 '07 #1
5 19270
markmcgookin
648 Expert 512MB
Hi guys!

What query should I use to retrieve a list of all the table names in an Access database? The effect would be similar to that of a simple "SHOW TABLES;" in MySql. To clear thing up, "SHOW TABLES;" does not work in Access(it says something like: "SELECT, INSERT, UPDATE or DELETE expected").

Thanks in advance.
I don't think this is possible with an SQL query, as they need tables to be pointed to. However, I am sure there would be some simple VB code you could embedd in a form to the same outcome.
Mar 7 '07 #2
ADezii
8,832 Expert 8TB
Hi guys!

What query should I use to retrieve a list of all the table names in an Access database? The effect would be similar to that of a simple "SHOW TABLES;" in MySql. To clear thing up, "SHOW TABLES;" does not work in Access(it says something like: "SELECT, INSERT, UPDATE or DELETE expected").

Thanks in advance.
The following SQL will return all 'Non System' Tables:
Expand|Select|Wrap|Line Numbers
  1. SELECT MSysObjects.Name, MSysObjects.Type
  2. FROM MSysObjects
  3. WHERE MSysObjects.Name Not Like "MsyS*" AND MSysObjects.Type=1
  4. ORDER BY MSysObjects.Name;
Mar 7 '07 #3
markmcgookin
648 Expert 512MB
The following SQL will return all 'Non System' Tables:
Expand|Select|Wrap|Line Numbers
  1. SELECT MSysObjects.Name, MSysObjects.Type
  2. FROM MSysObjects
  3. WHERE MSysObjects.Name Not Like "MsyS*" AND MSysObjects.Type=1
  4. ORDER BY MSysObjects.Name;
Well that shut me up! Nice post ADezii
Mar 7 '07 #4
ADezii
8,832 Expert 8TB
Well that shut me up! Nice post ADezii
Thanks. It just happened to be one of those 'little things' that I remembered over the years (LOL).
Mar 7 '07 #5
Thanks a lot!
My best regards!
Mar 8 '07 #6

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

Similar topics

3
by: 'bonehead | last post by:
Greetings, I'd like to figure out some syntax for retrieving the data from a table when I don't know all the of field names. What I do know are, the name of the table, the names of the primary...
4
by: sci | last post by:
Could someone help me by answering the questions below? What's a cursor? What's difference between Query and View? Is a RecordSet just part of a table? Can it be part of a query of view? If...
10
by: ynott | last post by:
I have an Access database with 58 fields in one table. I wrote many of the field names so that they were descriptive so that others could figure it out in the future. As an example, one field...
4
by: Martin Lacoste | last post by:
(Access 2000) Two issues: Within a query, I need to return a field name as data (see eg. below). I need to search within 80 fields (same criteria) - is there a way to avoid 80 separate...
6
by: ats | last post by:
I have a table that contains the database names of external databases. Each one of these external databases contain a table (which has the same structure) that I would like to query together as one...
6
by: Brian | last post by:
Hello, Basically, I'm running a query on a form's activation, and I'd like to have the results of the query be placed into other fields on the same form automatically. Does anybody know how...
13
by: Maxi | last post by:
I have a table (Table name : Lotto) with 23 fields (D_No, DrawDate, P1, P2,.....P21) and it has draw results from 1st Sep 2004 till date. I have another table (Table name : Check) with 15 fields...
4
by: deko | last post by:
When using OutputTo with a query, the 'File name' window in the 'Output To' dialog gets populated with the name of the query by default. This makes the exported file self-describing if the query...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
4
by: hapnendad | last post by:
In the question statement below Field names are in and variables are in (). All fields referenced are in what I have named the ‘PAR’ Table. Using MS Access 2003, I am working on a project...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.