You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Represents a query definition, or "querydef," usually one saved in a database.
11
11
12
12
> [!NOTE]
13
-
> DAO is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.
13
+
> Data Access Object (DAO) is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.
14
14
15
15
## Syntax
16
16
@@ -105,7 +105,7 @@ You can use a querydef object for any type of query, including select, action, c
105
105
106
106
To use a querydef object to create a `CDaoRecordset` object, you typically create or open a querydef as described above. Then construct a recordset object, passing a pointer to your querydef object when you call [`CDaoRecordset::Open`](../../mfc/reference/cdaorecordset-class.md#open). The querydef you pass must be in an open state. For more information, see class [`CDaoRecordset`](../../mfc/reference/cdaorecordset-class.md).
107
107
108
-
You cannot use a querydef to create a recordset (the most common use for a querydef) unless it's in an open state. Put the querydef into an open state by calling either `Open` or `Create`.
108
+
You can't use a querydef to create a recordset (the most common use for a querydef) unless it's in an open state. Put the querydef into an open state by calling either `Open` or `Create`.
109
109
110
110
## External Databases
111
111
@@ -150,7 +150,7 @@ BOOL CanUpdate();
150
150
151
151
### Return Value
152
152
153
-
Nonzero if you are permitted to modify the querydef; otherwise 0.
153
+
Nonzero if you're permitted to modify the querydef; otherwise 0.
154
154
155
155
### Remarks
156
156
@@ -223,7 +223,7 @@ The SQL string that defines the query. If you accept the default value of NULL,
223
223
224
224
If you pass a name in *lpszName*, you can then call [Append](#append) to save the querydef in the database's QueryDefs collection. Otherwise, the object is a temporary querydef and isn't saved. In either case, the querydef is in an open state, and you can either use it to create a [CDaoRecordset](../../mfc/reference/cdaorecordset-class.md) object or call the querydef's [Execute](#execute) member function.
225
225
226
-
If you don't supply a SQL statement in *lpszSQL*, you cannot run the query with `Execute` but you can use it to create a recordset. In that case, MFC uses the recordset's default SQL statement.
226
+
If you don't supply a SQL statement in *lpszSQL*, you can't run the query with `Execute` but you can use it to create a recordset. In that case, MFC uses the recordset's default SQL statement.
227
227
228
228
## <a name="execute"></a> CDaoQueryDef::Execute
229
229
@@ -248,7 +248,7 @@ An integer that determines the characteristics of the query. For related informa
248
248
249
249
- `dbFailOnError` Default value. Roll back updates if an error occurs and report the error to the user.
250
250
251
-
- `dbSeeChanges` Generate a run-time error if another user is changing data you are editing.
251
+
- `dbSeeChanges` Generate a run-time error if another user is changing data you're editing.
252
252
253
253
> [!NOTE]
254
254
> For an explanation of the terms "inconsistent" and "consistent," see the topic "Execute Method" in DAO Help.
@@ -430,7 +430,7 @@ The number of parameters defined in the query.
430
430
431
431
### Remarks
432
432
433
-
`GetParameterCount` is useful for looping through all parameters in the querydef. For that purpose, use `GetParameterCount`in conjunction with [GetParameterInfo](#getparameterinfo).
433
+
`GetParameterCount` is useful for looping through all parameters in the querydef. For that purpose, use `GetParameterCount` with [`GetParameterInfo`](#getparameterinfo).
434
434
435
435
For related information, see the topics "Parameter Object", "Parameters Collection", and "PARAMETERS Declaration (SQL)" in DAO Help.
436
436
@@ -468,7 +468,7 @@ A string containing the name of the desired parameter, for lookup by name. You c
468
468
469
469
### Remarks
470
470
471
-
For a description of the information returned in *`paraminfo`*, see the [`CDaoParameterInfo`](../../mfc/reference/cdaoparameterinfo-structure.md) structure. This structure has members that correspond to the descriptive information under *dwInfoOptions* above.
471
+
For a description of the information returned in *`paraminfo`*, see the [`CDaoParameterInfo`](../../mfc/reference/cdaoparameterinfo-structure.md) structure. This structure has members that correspond to the descriptive information under *`dwInfoOptions`* above.
472
472
473
473
For related information, see the topic "PARAMETERS Declaration (SQL)" in DAO Help.
474
474
@@ -549,7 +549,7 @@ The SQL statement that defines the query on which the querydef is based.
549
549
550
550
### Remarks
551
551
552
-
You'll then probably parse the string for keywords, table names, and so on.
552
+
You can parse the string for keywords, table names, and so on.
553
553
554
554
For related information, see the topics "SQL Property", "Comparison of Microsoft Jet Database Engine SQL and ANSI SQL", and "Querying a Database with SQL in Code" in DAO Help.
555
555
@@ -610,7 +610,7 @@ Nonzero if the `CDaoQueryDef` object is currently open; otherwise 0.
610
610
611
611
### Remarks
612
612
613
-
A querydef must be in an open state before you use it to call [Execute](#execute) or to create a [CDaoRecordset](../../mfc/reference/cdaorecordset-class.md) object. To put a querydef into an open state call either [Create](#create) (for a new querydef) or [Open](#open) (for an existing querydef).
613
+
A querydef must be in an open state before you use it to call [`Execute`](#execute) or to create a [`CDaoRecordset`](../../mfc/reference/cdaorecordset-class.md) object. To put a querydef into an open state, call either [`Create`](#create) (for a new querydef) or [`Open`](#open) (for an existing querydef).
@@ -626,7 +626,7 @@ Contains a pointer to the OLE interface for the underlying DAO querydef object.
626
626
627
627
### Remarks
628
628
629
-
This pointer is provided for completeness and consistency with the other classes. However, because MFC rather fully encapsulates DAO querydefs, you are unlikely to need it. If you do use it, do so cautiously. In particular, don't change the value of the pointer unless you know what you're doing.
629
+
This pointer is provided for completeness and consistency with the other classes. However, because MFC rather fully encapsulates DAO querydefs, you're unlikely to need it. If you do use it, do so cautiously. In particular, don't change the value of the pointer unless you know what you're doing.
630
630
631
631
## <a name="open"></a> CDaoQueryDef::Open
632
632
@@ -701,7 +701,7 @@ The number of seconds before a query times out.
701
701
702
702
### Remarks
703
703
704
-
This member function lets you override the default number of seconds before subsequent operations on the connected data source "time out." An operation might time out due to network access problems, excessive query processing time, and so on. Call `SetODBCTimeout`prior to executing a query with this querydef if you want to change the query timeout value. (As ODBC reuses connections, the timeout value is the same for all clients on the same connection.)
704
+
This member function lets you override the default number of seconds before subsequent operations on the connected data source "time out." An operation might time out due to network access problems, excessive query processing time, and so on. Call `SetODBCTimeout`before executing a query with this querydef if you want to change the query timeout value. (As ODBC reuses connections, the timeout value is the same for all clients on the same connection.)
705
705
706
706
The default value for query timeouts is 60 seconds.
707
707
@@ -772,9 +772,9 @@ A typical use of `SetSQL` is setting up a querydef object for use in a SQL pass-
The `CDaoQueryDefInfo` structure contains information about a querydef object defined for data access objects (DAO).
11
11
12
12
> [!NOTE]
13
-
> DAO is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.
13
+
> Data Access Object (DAO) is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.
14
14
15
15
## Syntax
16
16
@@ -35,7 +35,7 @@ struct CDaoQueryDefInfo
35
35
Uniquely names the querydef object. For more information, see the topic "Name Property" in DAO Help. Call [CDaoQueryDef::GetName](../../mfc/reference/cdaoquerydef-class.md#getname) to retrieve this property directly.
36
36
37
37
*m_nType*<br/>
38
-
A value that indicates the operational type of a querydef object. The value can be one of the following:
38
+
A value that indicates the operational type of a querydef object. The value can be one of:
39
39
40
40
-`dbQSelect` Select: the query selects records.
41
41
@@ -87,9 +87,9 @@ The number of seconds the Microsoft Jet database engine waits before a timeout e
87
87
88
88
## Remarks
89
89
90
-
The querydef is an object of class [CDaoQueryDef](../../mfc/reference/cdaoquerydef-class.md). The references to Primary, Secondary, and All above indicate how the information is returned by the [GetQueryDefInfo](../../mfc/reference/cdaodatabase-class.md#getquerydefinfo) member function in class `CDaoDatabase`.
90
+
The querydef is an object of class [CDaoQueryDef](../../mfc/reference/cdaoquerydef-class.md). The references to Primary, Secondary, and All indicate how the information is returned by the [GetQueryDefInfo](../../mfc/reference/cdaodatabase-class.md#getquerydefinfo) member function in class `CDaoDatabase`.
91
91
92
-
Information retrieved by the [CDaoDatabase::GetQueryDefInfo](../../mfc/reference/cdaodatabase-class.md#getquerydefinfo) member function is stored in a `CDaoQueryDefInfo` structure. Call `GetQueryDefInfo` for the database object in whose QueryDefs collection the querydef object is stored. `CDaoQueryDefInfo` also defines a `Dump` member function in debug builds. You can use `Dump` to dump the contents of a `CDaoQueryDefInfo` object. Class `CDaoDatabase` also supplies member functions for directly accessing all of the properties returned in a `CDaoQueryDefInfo` object, so you'll probably seldom need to call `GetQueryDefInfo`.
92
+
Information retrieved by the [CDaoDatabase::GetQueryDefInfo](../../mfc/reference/cdaodatabase-class.md#getquerydefinfo) member function is stored in a `CDaoQueryDefInfo` structure. Call `GetQueryDefInfo` for the database object in whose QueryDefs collection the querydef object is stored. `CDaoQueryDefInfo` also defines a `Dump` member function in debug builds. You can use `Dump` to dump the contents of a `CDaoQueryDefInfo` object. Class `CDaoDatabase` also supplies member functions for directly accessing all of the properties returned in a `CDaoQueryDefInfo` object, so you'll seldom call `GetQueryDefInfo`.
93
93
94
94
When you append a new field or parameter object to the Fields or Parameters collection of a querydef object, an exception is thrown if the underlying database doesn't support the data type specified for the new object.
The `CDaoRelationFieldInfo` structure contains information about a field in a relation defined for data access objects (DAO).
11
11
12
12
> [!NOTE]
13
-
> DAO is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.
13
+
> Data Access Objects (DAO) is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.
14
14
15
15
## Syntax
16
16
@@ -32,11 +32,11 @@ The name of the field in the foreign table of the relation.
32
32
33
33
## Remarks
34
34
35
-
A DAO relation object specifies the fields in a primary table and the fields in a foreign table that define the relation. The references to Primary in the structure definition above indicate how the information is returned in the `m_pFieldInfos` member of a [CDaoRelationInfo](../../mfc/reference/cdaorelationinfo-structure.md) object obtained by calling the [GetRelationInfo](../../mfc/reference/cdaodatabase-class.md#getrelationinfo) member function of class `CDaoDatabase`.
35
+
A DAO relation object specifies the fields in a primary table and the fields in a foreign table that define the relation. The references to Primary in the structure definition indicate how the information is returned in the `m_pFieldInfos` member of a [CDaoRelationInfo](../../mfc/reference/cdaorelationinfo-structure.md) object obtained by calling the [GetRelationInfo](../../mfc/reference/cdaodatabase-class.md#getrelationinfo) member function of class `CDaoDatabase`.
36
36
37
-
Relation objects and relation field objects are not represented by an MFC class. Instead, the DAO objects underlying MFC objects of class [CDaoDatabase](../../mfc/reference/cdaodatabase-class.md) contain a collection of relation objects, called the Relations collection. Each relation object, in turn, contains a collection of relation field objects. Each relation field object correlates a field in the primary table with a field in the foreign table. Taken together, the relation field objects define a group of fields in each table, which together define the relation. `CDaoDatabase` lets you access relation objects with a `CDaoRelationInfo` object by calling the `GetRelationInfo` member function. The `CDaoRelationInfo` object, then, has a data member, `m_pFieldInfos`, that points to an array of `CDaoRelationFieldInfo` objects.
37
+
Relation objects and relation field objects aren't represented by an MFC class. Instead, the DAO objects underlying MFC objects of class [CDaoDatabase](../../mfc/reference/cdaodatabase-class.md) contain a collection of relation objects, called the Relations collection. Each relation object, in turn, contains a collection of relation field objects. Each relation field object correlates a field in the primary table with a field in the foreign table. Taken together, the relation field objects define a group of fields in each table, which together define the relation. `CDaoDatabase` lets you access relation objects with a `CDaoRelationInfo` object by calling the `GetRelationInfo` member function. The `CDaoRelationInfo` object has a data member, `m_pFieldInfos`, that points to an array of `CDaoRelationFieldInfo` objects.
38
38
39
-
Call the [GetRelationInfo](../../mfc/reference/cdaodatabase-class.md#getrelationinfo) member function of the containing `CDaoDatabase` object in whose Relations collection is stored the relation object you are interested in. Then access the `m_pFieldInfos` member of the [CDaoRelationInfo](../../mfc/reference/cdaorelationinfo-structure.md) object. `CDaoRelationFieldInfo` also defines a `Dump` member function in debug builds. You can use `Dump` to dump the contents of a `CDaoRelationFieldInfo` object.
39
+
Call the [GetRelationInfo](../../mfc/reference/cdaodatabase-class.md#getrelationinfo) member function of the containing `CDaoDatabase` object in whose Relations collection is stored the relation object you're interested in. Then access the `m_pFieldInfos` member of the [CDaoRelationInfo](../../mfc/reference/cdaorelationinfo-structure.md) object. `CDaoRelationFieldInfo` also defines a `Dump` member function in debug builds. You can use `Dump` to dump the contents of a `CDaoRelationFieldInfo` object.
0 commit comments