Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2002
    Posts
    16

    Question Unanswered: Fields Descriptions ...

    Is there a way to get from a Table each
    Fields Description Column and put it to a table? ...

  2. #2
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    ALEXMIRI,

    Yes there is.

    One way is to use the DDL extension for ADO, ADOX. The Catalog object for the current connection has a collection of tables. Each table has a collection of columns. Each column has a collection of properties and the property you want is named "Description".
    Rod

    fe_rod@hotmail.com

  3. #3
    Join Date
    Aug 2002
    Posts
    16

    Question

    Thanks for ansewering Rod, sorry!, I forgot to mentioned that I am working with Access 97.

  4. #4
    Join Date
    Sep 2004
    Posts
    161
    You can use the tabledef collection of your db like this:
    for each table in currentdb.tabledefs
    for each field in table.Fields
    and for each field read th property you need

  5. #5
    Join Date
    Aug 2002
    Posts
    16

    Question Fields Description

    I whant to put the Fields Name, Data Type and Description in to a
    TEMP table, the sub procedure bellow only gives me the opportunity to get
    the properties for each field, but not the Data Type and Description columns
    on the Table ...

    ***** Sub FieldsTest()
    ***** *** Dim dbs As Database, tdf As TableDef, fld As Field
    ***** *** Dim dbsTemp As Database, rstTemp As Recordset

    ***** *** ' Return reference to current database.
    ***** *** Set dbs = CurrentDb
    ***** *** Set tdf = dbs.TableDefs!USN
    ***** *** Set dbsTemp = CurrentDb
    ***** *** Set rstTemp = dbsTemp.OpenRecordset("TEMP", dbOpenDynaset)
    ***** ***
    ***** *** For Each fld In tdf.Fields
    ***** ******* With rstTemp
    ***** *********** .AddNew
    ***** *********** ![Name] = fld.Name
    ***** ***** ***** ' ![Data Type] = ?
    ***** ***** ***** ' ![Description] = ?
    ***** *********** .Update
    ***** ******* End With
    ***** *** Next
    ***** End Sub

  6. #6
    Join Date
    Sep 2004
    Posts
    161
    with fld.Type
    For the description open a table in create mode and read the help

  7. #7
    Join Date
    Aug 2002
    Posts
    16

    Question Fiedls Descriptions ...

    For the description open a table in create mode and read the help

    Sorry!, I do not understand what you mean!

  8. #8
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    Alex,

    I'll duck out of this one since I believe Access 97 does not have ADO and jepi seems much more up to speed with DAO.
    Rod

    fe_rod@hotmail.com

Posting Permissions

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