Results 1 to 10 of 10

Thread: **Resolved** Data Type

  1. #1

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    **Resolved** Data Type

    Is there any way to find an Access 2000 fields data type using ADOX.
    I'm populating a tree with table names, then each nodes sub-nodes are the field names, I would like to append the field data type after their names.
    Last edited by GlenW; Apr 24th, 2002 at 05:59 AM.

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    24
    try this

    rs.Fields(0).Type ---> Data type

    rs.Fields(0).Precision

  3. #3

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Originally posted by Padma_Ananth_76
    try this

    rs.Fields(0).Type ---> Data type

    rs.Fields(0).Precision
    How do I then get the data type name from these numbers?

  4. #4
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641
    Martin J Wallace (Slaine)

  5. #5
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    this is from MSDN - the Type property of the Field object (ADO)

    Type Property (ADO)


    Indicates the operational type or data type of a Parameter, Field, or Property object.

    Settings and Return Values

    Sets or returns one of the following DataTypeEnum values. The corresponding OLE DB type indicator is shown in parentheses in the description column of the following table. For more information about OLE DB data types, see Chapter 10 and Appendix A of the OLE DB Programmer's Reference.

    Constant Description
    adArray Joined in a logical OR together with another type to indicate that the data is a safe-array of that type (DBTYPE_ARRAY).
    adBigInt An 8-byte signed integer (DBTYPE_I8).
    adBinary A binary value (DBTYPE_BYTES).
    adBoolean A Boolean value (DBTYPE_BOOL).
    adByRef Joined in a logical OR together with another type to indicate that the data is a pointer to data of the other type (DBTYPE_BYREF).
    adBSTR A null-terminated character string (Unicode) (DBTYPE_BSTR).
    adChar A String value (DBTYPE_STR).
    adCurrency A currency value (DBTYPE_CY). Currency is a fixed-point number with four digits to the right of the decimal point. It is stored in an 8-byte signed integer scaled by 10,000.
    adDate A Date value (DBTYPE_DATE). A date is stored as a Double, the whole part of which is the number of days since December 30, 1899, and the fractional part of which is the fraction of a day.
    adDBDate A date value (yyyymmdd) (DBTYPE_DBDATE).
    adDBTime A time value (hhmmss) (DBTYPE_DBTIME).
    adDBTimeStamp A date-time stamp (yyyymmddhhmmss plus a fraction in billionths) (DBTYPE_DBTIMESTAMP).
    adDecimal An exact numeric value with a fixed precision and scale (DBTYPE_DECIMAL).
    adDouble A double-precision floating point value (DBTYPE_R8).
    adEmpty No value was specified (DBTYPE_EMPTY).
    adError A 32-bit error code (DBTYPE_ERROR).
    adGUID A globally unique identifier (GUID) (DBTYPE_GUID).
    adIDispatch A pointer to an IDispatch interface on an OLE object (DBTYPE_IDISPATCH).
    adInteger A 4-byte signed integer (DBTYPE_I4).
    adIUnknown A pointer to an IUnknown interface on an OLE object (DBTYPE_IUNKNOWN).
    adLongVarBinary A long binary value (Parameter object only).
    adLongVarChar A long String value (Parameter object only).
    adLongVarWChar A long null-terminated string value (Parameter object only).
    adNumeric An exact numeric value with a fixed precision and scale (DBTYPE_NUMERIC).
    adSingle A single-precision floating point value (DBTYPE_R4).
    adSmallInt A 2-byte signed integer (DBTYPE_I2).
    adTinyInt A 1-byte signed integer (DBTYPE_I1).
    adUnsignedBigInt An 8-byte unsigned integer (DBTYPE_UI8).
    adUnsignedInt A 4-byte unsigned integer (DBTYPE_UI4).
    adUnsignedSmallInt A 2-byte unsigned integer (DBTYPE_UI2).
    adUnsignedTinyInt A 1-byte unsigned integer (DBTYPE_UI1).
    adUserDefined A user-defined variable (DBTYPE_UDT).
    adVarBinary A binary value (Parameter object only).
    adVarChar A String value (Parameter object only).
    adVariant An Automation Variant (DBTYPE_VARIANT).
    adVector Joined in a logical OR together with another type to indicate that the data is a DBVECTOR structure, as defined by OLE DB, that contains a count of elements and a pointer to data of the other type (DBTYPE_VECTOR).
    adVarWChar A null-terminated Unicode character string (Parameter object only).
    adWChar A null-terminated Unicode character string (DBTYPE_WSTR).


    Remarks

    For Parameter objects, the Type property is read/write. For all other objects, the Type property is read-only.
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  6. #6

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Thanks guys, but when I call the Type property I get a number.
    202 for text, 11 for Bool etc.
    How do I get the text values in lists you quoted.

  7. #7
    khalik
    Guest
    i hope its the complete list o datatypes....
    by the way are any diff when we access oracel database

  8. #8
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    Originally posted by GlenW
    Sorted using a **** of a Select Case Statement.
    fantastic description
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  9. #9

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Originally posted by darre1


    fantastic description
    Thanks it took a long time to censor the original.

  10. #10
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289
    what is the data type to use with Text data type of database???

    i dont know the size of record and varchar need that i fill the size of field.

    daniel
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

Posting Permissions

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



Click Here to Expand Forum to Full Width