SQL Command to List all Tables?

  • Thread starter Thread starter Harry Whitehouse
  • Start date Start date
H

Harry Whitehouse

I'm trying to read an Access database from a C++ program and get a list of
the table names in the target MDB. I've done this with SQL Server with this
command which invokes a stored procedure:

sp_help

How does one to this in Access?

TIA

Harry
 
Access objects are stored in a table called MsysObjects and each type of
object has a different type number, a table is one. To see a list of all
tables you could use the following SQL:

SELECT Name
FROM MsysObjects
WHERE (((Type)=1));

This will include system tables so to exclude them you could use:
SELECT Name
FROM MsysObjects
WHERE (((Type)=1) AND ((Name) Not Like "msys*"));



Hth

Stu
 
Back
Top