共用方式為


CDaoDatabase::GetQueryDefInfo

void GetQueryDefInfo( int nIndex**, CDaoQueryDefInfo&** querydefinfo**,DWORD** dwInfoOptions = AFX_DAO_PRIMARY_INFO );
throw( CDaoException, CMemoryException );

void GetQueryDefInfo( LPCTSTR lpszName**, CDaoQueryDefInfo&** querydefinfo**,DWORD** dwInfoOptions = AFX_DAO_PRIMARY_INFO );
throw( CDaoException, CMemoryException );

Parameters

nIndex

The index of the predefined query in the database’s QueryDefs collection, for lookup by index.

querydefinfo

A reference to a CDaoQueryDefInfo object that returns the information requested.

dwInfoOptions

Options that specify which information about the recordset to retrieve. The available options are listed here along with what they cause the function to return about the recordset:

  • AFX_DAO_PRIMARY_INFO   (Default) Name, Type

  • AFX_DAO_SECONDARY_INFO   Primary information plus: Date Created, Date of Last Update, Returns Records, Updatable

  • AFX_DAO_ALL_INFO   Primary and secondary information plus: SQL, Connect, ODBCTimeout

lpszName

A string containing the name of a query defined in the database, for lookup by name.

Remarks

Call this member function to obtain various kinds of information about a query defined in the database. Two versions of the function are supplied so you can select a query either by index in the database’s QueryDefs collection or by the name of the query.

For a description of the information returned in querydefinfo, see the CDaoQueryDefInfo structure. This structure has members that correspond to the items of information listed above in the description of dwInfoOptions. If you request one level of information, you get any prior levels of information as well.

For information about queries and querydef objects, see the articles and . Both articles are in Visual C++ Programmer's Guide.

CDaoDatabase OverviewClass MembersHierarchy Chart

See Also   CDaoDatabase::GetQueryDefCount