Retrieving table field properties

Discussion in 'ASP General' started by hytga, Jun 10, 2004.

  1. hytga

    hytga Guest

    hi can n e 1 tell me if there's a way to get the column properties from a
    table?
    properties like caption, description etc

    thank you
     
    hytga, Jun 10, 2004
    #1
    1. Advertising

  2. hytga

    Ray at Guest

    What kind of database?

    Ray at work

    "hytga" <> wrote in message
    news:wpQxc.53959$...
    > hi can n e 1 tell me if there's a way to get the column properties from a
    > table?
    > properties like caption, description etc
    >
    > thank you
    >
    >
     
    Ray at, Jun 10, 2004
    #2
    1. Advertising

  3. hytga

    hytga Guest


    > What kind of database?

    MS Access
     
    hytga, Jun 10, 2004
    #3
  4. hytga

    hytga Guest


    > look here perhaps for an idea
    > http://www.darkfalz.com/1065


    well it comes close to what i need. here's what i've been trying to do
    but the below code gives error

    Error Type:
    ADODB.Properties (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name
    or ordinal.




    <!-- connection is already open ud_conn-->

    ' retrieve fields
    set rsMyAcct=Server.CreateObject("ADODB.Recordset")
    strSQL="SELECT * FROM [Users] WHERE Usr_ID='" & UCASE(userid) & "'"
    rsMyAcct.Open strSQL , ud_Conn

    Set rsProp = Server.CreateObject("ADOX.Catalog")
    rsProp.ActiveConnection = ud_conn

    if not rsMyAcct.eof then
    For each Field in rsMyAcct.Fields

    THIS IS THE ERROR LINE>>>>>>> response.write
    rsProp.Tables("Users").Columns(Field.Name).Properties("Description").Value
    & "<br>"

    next
    end if


    Set rsProp= nothing
    rsMyAcct.Close
    Set rsMyAcct = Nothing



    -----------------
    n e ideas?
     
    hytga, Jun 10, 2004
    #4
  5. hytga wrote:
    > hi can n e 1 tell me if there's a way to get the column properties
    > from a table?
    > properties like caption, description etc
    >
    > thank you


    You will not be able to get at all of these properties via ADO. Caption and
    Description are Access-defined properties. Description is exposed by the Jet
    OLEDB provider; Caption is not. You need to keep in mind that Access is not
    the database: Jet is the database. Access is a front-end tool for working
    with Jet databases. One of the things Access to make it easier for users is
    add properties to the database that Jet does not provide. Some of these
    properties are exposed by the Jet OLEDB provider, and some are not.

    Most of the other column properties can be read using ADOX, which is
    installed with ADO. See here for a start:
    http://www.aspfaq.com/show.asp?id=2244

    See here for the Jet database properties that can be read using ADOX:
    http://msdn.microsoft.com/library/en-us/ado270/htm/mdrefjetprovspec.asp

    HTH,
    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jun 10, 2004
    #5
  6. hytga

    hytga Guest

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > hytga wrote:
    > > hi can n e 1 tell me if there's a way to get the column properties
    > > from a table?
    > > properties like caption, description etc
    > >
    > > thank you

    >
    > You will not be able to get at all of these properties via ADO. Caption

    and
    > Description are Access-defined properties. Description is exposed by the

    Jet
    > OLEDB provider; Caption is not. You need to keep in mind that Access is

    not
    > the database: Jet is the database. Access is a front-end tool for working
    > with Jet databases. One of the things Access to make it easier for users

    is
    > add properties to the database that Jet does not provide. Some of these
    > properties are exposed by the Jet OLEDB provider, and some are not.
    >
    > Most of the other column properties can be read using ADOX, which is
    > installed with ADO. See here for a start:
    > http://www.aspfaq.com/show.asp?id=2244
    >
    > See here for the Jet database properties that can be read using ADOX:
    > http://msdn.microsoft.com/library/en-us/ado270/htm/mdrefjetprovspec.asp
    >
    > HTH,
    > Bob Barrows
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    hytga, Jun 11, 2004
    #6
  7. hytga

    hytga Guest

    Thank you i'll give it a try
     
    hytga, Jun 11, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vik
    Replies:
    1
    Views:
    2,838
    =?Utf-8?B?VHUtVGhhY2g=?=
    Apr 16, 2004
  2. J Sahoo
    Replies:
    3
    Views:
    5,346
    naikpalak
    Apr 30, 2009
  3. Replies:
    1
    Views:
    171
    R. Rajesh Jeba Anbiah
    Jan 13, 2005
  4. Sound
    Replies:
    2
    Views:
    498
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    495
Loading...

Share This Page