Results 1 to 5 of 5
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Listing Fields in a Table (Access 2003/SP3)

    The following statement will list all the tables in my database,
    I'm looking for a variation to list all the fields in each table...
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Listing Fields in a Table (Access 2003/SP3)

    "The following statement" must be extremely compact... I fail to see it.

    BTW have you tried Tools | Analyze | Documenter, or our own Mark Liquorman's Liquorman Utilities?

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Listing Fields in a Table (Access 2003/SP3)

    Snicker - too much multitasking


    How about
    SELECT MsysObjects.Name, MsysObjects.Type
    FROM MsysObjects
    WHERE (((MsysObjects.Type)=6))
    ORDER BY MsysObjects.Name;


    Documenter didn't do it for me - I'll check out Mark's utility.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Listing Fields in a Table (Access 2003/SP3)

    I don't think you can use SQL to list the fields in a table. You could use DAO code to loop through the tables in the database, and to loop through the fields in each table.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Listing Fields in a Table (Access 2003/SP3)

    I am still researching this but for a SQL server it is pretty simple:

    SELECT COLUMN_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE (TABLE_NAME = 'incident')


    where incident is the table name. This will just show the names of the fields not their properties
    Jerry

Posting Permissions

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