Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Smile Unanswered: How to retreive datatype info from Access.

    Hello,

    I like to know if you can retreive column information like
    datatype, default_value etc. from Access.

    The reason why I want to do this, is that I generate insert and update statements with Vbscript. I need the datatype of the columns to determine if I need to put qoutes around values (in the case of text) or not (in the case of number). In the case of a autonumber datatype, I want the value to be ignored.

    I am using Vbscript on IIS to build a dynamic website. I
    used to work with Oracle and I could retreive column
    information from the datadictionary using SQL e.g.

    select column_name
    , data_type
    from all_columns

    How does this work in Access

    I suppose you use ADO or DAO. Can anybody tell me which model to use and how to use it to retreive column information?

    an example would be nice

    Thanx in advance

    Holke
    ..

  2. #2
    Join Date
    Jan 2004
    Location
    Germany;Lueneburg
    Posts
    1

    Re: How to retreive datatype info from Access.

    Hi Holke,

    if you use VB try that one

    dim rst
    set rst = createobject("ADODB.RECORDSET") 'any version

    rst.Open "KundeVertr", strconn

    For Each x In rst.Fields
    Debug.Print x.Type 'will return a integer which describes a DataTypeEnum fron ADOBD
    Next

    Hope that helps


    Originally posted by holke
    Hello,

    I like to know if you can retreive column information like
    datatype, default_value etc. from Access.

    The reason why I want to do this, is that I generate insert and update statements with Vbscript. I need the datatype of the columns to determine if I need to put qoutes around values (in the case of text) or not (in the case of number). In the case of a autonumber datatype, I want the value to be ignored.

    I am using Vbscript on IIS to build a dynamic website. I
    used to work with Oracle and I could retreive column
    information from the datadictionary using SQL e.g.

    select column_name
    , data_type
    from all_columns

    How does this work in Access

    I suppose you use ADO or DAO. Can anybody tell me which model to use and how to use it to retreive column information?

    an example would be nice

    Thanx in advance

    Holke
    ..

Posting Permissions

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