QueryDef members (DAO)

Applies to: Access 2013, Office 2013

A QueryDef object is a stored definition of a query in a Microsoft Access database engine database.

Methods

Name

Description

Cancel

NOTE: ODBCDirect workspaces are not supported in Microsoft Access 2013. Use ADO if you want to access external data sources without using the Microsoft Access database engine.

Cancels execution of a pending asynchronous method call (ODBCDirect workspaces only).

Close

Closes an open QueryDef.

CreateProperty

Creates a new user-defined Property object (Microsoft Access workspaces only).

Execute

Executes an SQL statement on the specified object.

OpenRecordset

Creates a new Recordset object and appends it to the Recordsets collection.

Properties

Name

Description

CacheSize

Sets or returns the number of records retrieved from an ODBC data source that will be cached locally. Read/write Long.

Connect

Sets or returns a value that provides information about the source of database used in a pass-through query. Read-only String.

DateCreated

Returns the date and time that an object was created (Microsoft Access workspaces only). Read-only Variant.

Fields

Returns a Fields collection that represents all stored Field objects for the specified object. Read-only.

LastUpdated

Returns the date and time of the most recent change made to an object. Read-only Variant.

MaxRecords

Sets or returns the maximum number of records to return from a query against an ODBC data source.

Name

Returns or sets the name of the specified object. Read/write String.

ODBCTimeout

Indicates the number of seconds to wait before a timeout error occurs when a QueryDef is executed on an ODBC database.

Parameters

Returns a Parameters collection that contains all of the Parameter objects of the specified QueryDef. Read-only.

Prepare

NOTE: ODBCDirect workspaces are not supported in Microsoft Access 2013. Use ADO if you want to access external data sources without using the Microsoft Access database engine.

Sets or returns a value that indicates whether the query should be prepared on the server as a temporary stored procedure, using the ODBC SQLPrepare API function, prior to execution, or just executed using the ODBC SQLExecDirect API function (ODBCDirect workspaces only). Read/Write QueryDefStateEnum.

Properties

Returns the Properties collection of the specified object. Read-only.

RecordsAffected

Returns the number of records affected by the most recently invoked Execute method.

ReturnsRecords

Sets or returns a value that indicates whether an SQL pass-through query to an external database returns records (Microsoft Access workspaces only).

SQL

Sets or returns the SQL statement that defines the query executed by a QueryDef object.

StillExecuting

NOTE: ODBCDirect workspaces are not supported in Microsoft Access 2013. Use ADO if you want to access external data sources without using the Microsoft Access database engine.

Indicates whether or not an asynchronous operation (that is, a method called with the dbRunAsync option) has finished executing (ODBCDirect workspaces only).

Type

Sets or returns a value that indicates the operational type or data type of an object. Read-onlyInteger.

Updatable

Returns a value that indicates whether you can change a DAO object. Read-only Boolean.