Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Location
    Colorado
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table information... (Access 97 / 2000)

    I have written code to dump to the debug.print window the listing of each field for a given table as well as the field's type (Number, Text, etc.) Is there any way to also write code that will pull out an individual field's "description", as displayed in a table's design view?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table information... (Access 97 / 2000)

    For the Table description use
    CurrentDb.TableDefs("YourTable").Properties("Descr iption")
    For the Field description use
    CurrentDb.TableDefs("YourTable").Fields("YourField ").Properties("Description")
    Francois

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Table information... (Access 97 / 2000)

    Francois is correct as long as you are dealing with local tables - linked tables may give you problems however. I haven't actually tried it with SQL Server 2000, but version 7.0 had no description field where you could put that, and if you tried to put it into the design view of the Access front-end, it wouldn't let you.
    Wendell

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Table information... (Access 97 / 2000)

    I don't remember how version 7.0 handled it, but SQL Server 2000 has a description property for each column. It shows up in table design view much as it does in Access in table design ... but it only shows up in SQL Server. You can't see those descriptions in design view in an Access MDB. I haven't tried looking for them in code.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Feb 2002
    Location
    Colorado
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table information... (Access 97 / 2000)

    The code Francois sent worked fine -- even with linked tables. At least it worked with linked tables in the backend database located on the same server as the front end. Also, it took a bit longer to return the information from the linked tables. I'd say the response time was almost instantaneous for native tables and somewhere between 3 and 4 seconds for linked tables. I have not tried the code with SQL server yet -- but that may be part of my next project. Thanks for all the input!

Posting Permissions

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