Results 1 to 4 of 4

Thread: Abstracting Table Names

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Yorkshire, UK
    Posts
    20

    Post

    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


  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Code:
        For Each td In db.TableDefs
            
            If td.Attributes = 0 Then
                MsgBox td.Name
            End If
            
        Next td

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Yorkshire, UK
    Posts
    20

    Post

    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


  4. #4
    State Guy
    Guest

    Talking

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width