Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004
    Posts
    75

    Unanswered: Quickie...SELECT list of tables?

    Hey all, just a quick question, is it possible to have a list/combo box populated with a list of the names of every table in the database?
    Thanks
    Bane

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    SELECT name from MSysObjects WHERE type=1 AND left$(name, 4) <> "MSys";
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Oct 2004
    Posts
    75
    Too good, thanks Teddy =)

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try also
    PHP Code:
    SELECT MSysObjects.Name
       FROM MSysObjects
         WHERE 
    (((MSysObjects.FlagsNot In (-2147483648,2,-2147483645)) AND        
            ((
    MSysObjects.TypeIn (1,4)))
       
    ORDER BY MSysObjects.Name

  5. #5
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404
    Quote Originally Posted by Teddy
    SELECT name from MSysObjects WHERE type=1 AND left$(name, 4) <> "MSys";
    For some reason this didn't work for my database (XP), instead I found:

    SELECT name from MSysObjects WHERE (type=1 OR type=6) AND left$(name, 4) <> "MSys";

    returned all the tables. Using type=1 only returned about six tables.


  6. #6
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    I think

    Type 1; native Access tables
    Type 4; linked ODBC tables (SQL server...)
    Type 6: linked Jet (Access) tables
    Roy-Vidar

Posting Permissions

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