>

Type Property

Applies To

Dynaset-Type Recordset Object, Field Object, Parameter Object, Property Object, QueryDef Object, Recordset Object, Snapshot-Type Recordset Object, Table-Type Recordset Object.

Description

Sets or returns a value that indicates the operational type or data type of an object. For a Field or Property object, this property is read/write until the object is appended to a collection or to another object, after which it's read-only. For a Parameter, QueryDef, or Recordset object, the property setting is read-only.

Settings and Return Values

The setting or return value is a constant that indicates an operational or data type. The data type is Integer.

For a Field, Parameter, or Property object, the possible settings and return values are:

Setting/Value

Description

dbBoolean

Boolean

dbByte

Byte

dbInteger

Integer

dbLong

Long

dbCurrency

Currency

dbSingle

Single

dbDouble

Double

dbDate

Date/Time

dbText

Text

dbLongBinary

Long Binary (OLE Object)

dbMemo

Memo

dbGUID

GUID


For a QueryDef object, the possible settings and return values are:

Setting/Values

Query type

dbQSelect

Select

dbQAction

Action

dbQCrosstab

Crosstab

dbQDelete

Delete

dbQUpdate

Update

dbQAppend

Append

dbQMakeTable

Make-table

dbQDDL

Data-definition

dbQSQLPassThrough

Pass-through

dbQSetOperation

Union

dbQSPTBulk

Used with dbQSQLPassThrough to specify a query that doesn't return records.


Note

To create an SQL pass through query, don't set the dbQSQLPassThrough constant. This is set automatically by the Microsoft Jet database engine when you create a QueryDef object and set the Connect property.

For a Recordset object, the possible settings and return values are:

Setting

Recordset type

dbOpenTable

Table

dbOpenDynaset

Dynaset

dbOpenSnapshot

Snapshot


Remarks

These constants are listed in the Data Access (DAO) object library in the Object Browser.

Depending on the object, the Type property indicates:

Object

Type indicates

Field, Parameter, Property

Object data type

QueryDef

Type of query

Recordset

Type of Recordset object


When you append a new Field, Parameter, or Property object to the collection of an Index, QueryDef, Recordset, or TableDef object, an error occurs if the underlying database doesn't support the data type specified for the new object.

Specifics (Microsoft Access)

In Microsoft Access, you can set the data type for a field in table Design view, and you can set the data type for a parameter in the Query Parameters dialog box. These actions are equivalent to setting the data access Type property for a Field object or a Parameter object from Visual Basic.

The following table lists the Type property constants and the corresponding Microsoft Access settings for field and parameter data types if you are setting them from table Design view or the Query Parameters dialog box.

When creating a table field with data type Number, set the FieldSize property to specify which of the six numeric data types the field will be. By default this property is set to Long Integer. The other settings are Byte, Integer, Single, Double, and ReplicationID.


Constant

Table field
setting

Query parameter
setting

dbBoolean

Yes/No

Yes/No

dbByte

Number
(FieldSize = Byte)

Byte

dbCurrency

Currency

Currency

dbDate

Date/Time

Date/Time



Constant

Table field
setting

Query parameter
setting

dbDouble

Number
(FieldSize = Double)

Double

dbGUID

Number or AutoNumber
(FieldSize = ReplicationID)

Not supported

dbInteger

Number
(FieldSize = Integer)

Integer

dbLong

Number
(FieldSize = Long Integer)

Long Integer

AutoNumber
(FieldSize = Long Integer)

Not supported

dbLongBinary

OLE Object

OLE Object

Not supported

Binary

dbMemo

Memo

Memo

dbSingle

Number
(FieldSize = Single)

Single

dbText

Text

Text

Not supported

Not supported

Value


Note

The parameter data type Value doesn't correspond to a data type defined by the Microsoft Jet database engine. It corresponds to the SQL reserved word VALUE, which can be used to create a parameter query. In Microsoft Access or SQL queries, VALUE can be considered a valid synonym for the Visual Basic Variant data type.

Example

See the Size property example.

Example (Microsoft Access)

See the Size property example (Microsoft Access).

Example (Microsoft Excel)

See the Size property example (Microsoft Excel).