Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need list of TABLE name.

Status
Not open for further replies.

FastEdge

Programmer
Jun 24, 2004
3
US
Hello, I need to great a query that will return a list of all table names in a DB. I appreciate the help.

Ed.
 
This is the recommended approach I use...
Dim db As Database
Dim tdf As TableDef
Set db = DBEngine(0)(0)
For Each tdf In db.TableDefs
Debug.Print tdf.Name
'Or store in a table for later use.
Next tdf
Set db = Nothing


Or you could view the system table "MSysObjects". You will need to use Tools->Options->View Tab->System Objects. Look for Type Code 6, I think.

htwh,




Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Thanks for the reply, but I don't think either suggestion is what I'm looking for. I could be wrong. Let me elaborate.

I'm developing in Cold Fusion. To get data from the DB I use Jet SQL within a CF query tag. The CF becomes almost irrelevant at this point. Normally it would look something like this.

<cfquery datasource="DB" name="DB_REC">
Select * from TABLE
Where Blah = Blah
</cfquery>

Now, within these parameters, how do I grab a list of table names? Any ideas?

Thanks again,
Ed
 
Wow, would have worked except for permissions. So I guess the problem now is how do I change permissions on a DB that I can access via SQL only? It's a live database and replacing it would inevitably delete some data. So changes have to be made via SQL.

Thanks,
Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top