This property, which is read-only, indicates the data type of a Field object.
var = field.Type
One of the values described in the following table is returned.
Constant |
Value |
Description |
adVarWChar | 202 | Null-terminated Unicode character string of <256 characters |
adLongVarWChar | 203 | Null-terminated Unicode character string |
adVarBinary | 204 | Binary value of <256 bytes |
adLongVarBinary | 205 | Binary value of <=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/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.
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
Dim rs, n
Set rs = CreateObject ("adoce.recordset")
rs.Open "table1"
For n = 0 to rs.Fields.Count -1
MsgBox rs.Fields(n).Type
Next