PDA

Click to See Complete Forum and Search --> : Abstracting Table Names


Rick B
Feb 22nd, 2000, 06:53 PM
Can anyone help me. I have been able to abstract from my MyFile.mdb database all the Tables that are contained within.

The following seems to work.

For Each Td In Data1.Database.TableDefs
If (Left(Td.Name, 4) <> "MSys") Then
CBox1.AddItem Td.Name
Else
'Add Nothing
End If
Next

As well as adding the table names to a combobox I get other entries such as

MSysQueries
MSysACE's
MSysRelationships
MSysObjects

As you can see I'm removing these entries by using the If (Left(Td.Name, 4) <> "MSys") Then statement.

Is there a better or even correct way of gettting the Table names without the MSys...

Thanks

Clunietp
Feb 23rd, 2000, 01:13 PM
For Each td In db.TableDefs

If td.Attributes = 0 Then
MsgBox td.Name
End If

Next td

Rick B
Feb 24th, 2000, 05:03 AM
Thanks Clunietp, that seemed to work fine.

I have another problem though.

Is it possible to get the Table names without invoking a data1.refresh when I change the DatabaseName and/or Recordsource.

Thanks again

State Guy
Jan 9th, 2002, 06:09 PM
This seems to be the answer I'm looking for. A big question is: do system tables all begin with "Msys?" Another is: does the "attribute = 0" mean a system table? Therefore (if so) any "attribute > 0" (or <> 0) would be a user-defined table?

Are queries setup the same way ("msys" and "attribute = 0")?

If so, I'll love you guys forever...

:-P