Type

This property indicates the data type of a Field object.

This property is read-only.

Syntax

var = field.Type

Return Values

One of the values described in the following table is returned.

Constant Value Description
adVarWChar 202 Null-terminated Unicode character string of less than 256 characters
adLongVarWChar 203 Null-terminated Unicode character string
adVarBinary 204 Binary value of less than 256 bytes
adLongVarBinary 205 Binary value less than or equal to 65469 (4096*16 - 3) bytes
adInteger 3 4-byte signed integer
adSmallInt 2 2-byte signed integer
adDouble 5 Double-precision floating point value
adDate 7 Date value
adUnsignedSmallInt 18 2-byte unsigned integer
adUnsignedInt 19 4-byte unsigned integer
adBoolean 11 Boolean True or False value
adDouble 5 Double-precision floating point number

ADO for the desktop computer supports other values for Type, but ADOCE does not support or return those values.

Examples

The following code example sets the constants for the Type property.

Const adVarWChar = 202
Const adLongVarWChar = 203
Const adVarBinary = 204
Const adLongVarBinary = 205
Const adInteger = 3
Const adSmallInt  = 2
Const adDouble = 5
Const adDate = 7
Const adUnsignedSmallInt = 18
Const adUnsignedInt  = 19
Const adBoolean = 11
Const adDouble = 5

The following code example displays the data types of all fields in the table MyTable.

Dim rs, n
Set rs = CreateObject ("adoce.recordset")
rs.Open "myTable"
For n = 0 to rs.Fields.Count -1
MsgBox rs.Fields(n).Type
Next