Description
Call this function to open a querydef previously saved in the database’s QueryDefs collection.
Once the querydef is open, you can call the QDExecute function with its handle or use the querydef to create a CDaoRecordset object.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Name A string that contains the name of the saved querydef to open.
QDHandle |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
QDHandle |
FResult |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function when you finish using the querydef object.
Closing the querydef releases the underlying DAO object but does not destroy the saved DAO querydef object or the C++ CDaoQueryDef object.
This is not the same as DBDeleteQueryDef, which deletes the querydef from the database’s QueryDefs collection in DAO (if not a temporary querydef).
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
QDHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to create a new DAO querydef object and associate it with the MFC CDaoWorkspace object.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
QueryName The unique name of the query saved in the database.
You must not specify an
already used name, otherwise an Exception will occur, and this function will
return -2.
If you accept the default value, an empty string, a temporary querydef is created.
Such a query is not saved in the QueryDefs collection.
SQLQueryString A pointer to a string that is an SQL statement defining the QueryDef.
QDHandle in |
QueryName |
SQLQueryString |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
his function deletes the QueryDef object. The handle should not be used after being passed to this function.
Parameters
qdHdl Handle of the QueryDef object
QDHandle |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to run the query defined by the querydef object. Querydef objects used for execution in this manner can only represent one of the following query types:
* Action queries
* SQL pass-through queries
Execute does not work for queries that return records, such as select queries. Execute is commonly used for bulk operation queries, such as UPDATE, INSERT, or SELECT INTO, or for data definition language (DDL) operations.
Tip: The preferred way to work with ODBC data sources is to attach tables to a Microsoft Jet (.MDB) database.
Call the QDGetRecordsAffected member function with the querydef object handle to determine the number of records affected by the most recent Execute call.
For example, QDGetRecordsAffected returns information about the number of records deleted, updated, or inserted when executing an action query.
The count returned will not reflect changes in related tables when cascade updates or deletes are in effect.
If you include both dbInconsistent and dbConsistent or if you include neither, the error is the default, dbInconsistent.
Execute does not return a recordset. Using Execute on a query that selects records causes MFC to throw an exception of type CDaoException, and this function to return -2.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Options An integer that specifies options relating to the integrity of the query.
You can use the bitwise-OR operator (|) to combine any of the following (provided the combination makes sense - for example, you would not combine 16 (inconsistent) with 32 (consistent)):
1 Deny write permission to other users
16 (Default) Inconsistent updates
32 Consistent updates
64 SQL pass-through. Causes the SQL statement to be
passed to an ODBC data source for processing
128 (Default) Roll back updates if an error occurs
512 Generate a run-time error if another user is
changing data you are editing
Note: If both 16 (Inconsistent) and 32 (Consistent) are included or if neither is included, the error is the default.
QDHandle |
Options |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
QDHandle |
FResult |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to retrieve the number of fields in the query.
GetFieldCount is useful for looping through all fields in the querydef. For that purpose, use QDGetFieldCount in conjunction with one of the QDGetFieldInfo-Functions.
Parameters
FieldCount -1 if handle not initialized, -2 if Error,
any other value represents the number of fields defined in the Query.
qdHdl Handle of the QueryDef object
QDHandle |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FieldCount |
QDHandle |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to obtain various kinds of information about a field defined in the querydef.
One version of the function (this one) lets you look up a Field by index.
The other version (QDGetFieldInfoByName) lets you look up a Field by name.
For a description of the information returned in fiHdl, see the FI...-Functions. These all return certain items of information.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Index The zero-based index of the desired field in the querydef’s Fields collection
fiHdl A handle of a FieldInfo object that will contain the information requested.
QDHandle |
FIHandle in |
Index |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
FIHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to obtain various kinds of information about a field defined in the querydef.
One version of the function (this one) lets you look up a Field by name.
The other version (QDGetFieldInfoByIdx) lets you look up a Field by Index.
For a description of the information returned in fiHdl, see the FI...-Functions. These all return certain items of information.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Name A string containing the name of the desired field
fiHdl A handle of a FieldInfo object that will contain the information requested.
QDHandle |
FIHandle out |
Name |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
FIHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to retrieve the number of parameters in the saved query.
GetParameterCount is useful for looping through all parameters in the querydef. For that purpose, use QDGetParameterCount in conjunction with the QDGetParameterInfo functions.
Parameters
NumberParameter -1 if handle not initialized, -2 if an Error occurred;
any other value represents the number of parameters defined in the query.
qdHdl Handle of the QueryDef object
QDHandle |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
NumberParameter |
QDHandle |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
all this function to obtain various kinds of information about a parameter defined in the querydef.
One version of the function (this one) lets you look up a Parameter by index.
The other version (QDGetParameterInfoByName) lets you look up a Parameter by name.
For a description of the information returned in piHdl, see the PI...-Functions. These all return certain items of information.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Index The zero-based index of the desired parameter in the querydef’s Parameters collection.
piHdl A handle of a ParameterInfo object that will contain the information requested.
QDHandle |
Index |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
ParameterInfo |
Name |
Type |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to obtain information about a parameter defined in the querydef.
Parameters
QDHandle in Query Def Handle (Input)
lpszName A string containing the name of the desired parameter
QDHandle out Query Def Handle (Output)
ParameterInfo A cluster containig the requested information
error in - a cluster describing the error state before executing the current VI. If the error state is TRUE, the VI will just pass the error cluster and incoming handle, no operation will happen.
error out - a cluster that describes the error status after this VI executes. If the error status is TRUE, an error occured. The DAO Error message (AKA source) is combined from the DAO-dll-call, and, where available, additional input-parameters. The DAO Error codes are always defined as:
-1 Handle not initialized
-2 Error
XOn Software GmbH
QDHandle |
Name |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
ParameterInfo |
Name |
Type |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to retrieve the current value of the specified parameter stored in the querydef’s Parameters collection.
Using this function, You can access the parameter by its ordinal position in the collection. For accessing it by name, You have to use QDGetParamValueByName.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Index The zero-based index of the desired parameter in the querydef’s Parameters collection.
ovHdl A handle of a COleVariant object that will contain the parameter’s value.
QDHandle |
Index |
OVHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
OVHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to retrieve the current value of the specified parameter stored in the querydef’s Parameters collection.
Using this function, You can access the parameter by its name.
For accessing it by its ordinal position in the collection, You have to use QDGetParamValueByIdx
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Name The name of the parameter whose value you want
ovHdl A handle of a COleVariant object that will contain the parameter’s value.
QDHandle |
Name |
OVHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
OVHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
QDHandle |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
QDHandle |
QueryDefInfo |
Name |
Connect |
SQLStatement |
Type |
ReturnsRecords |
ODBCTimeout |
CanUpdate |
DateCreated |
DateLastUpdated |
FResult |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to determine how many records were affected by the last call of QDExecute.
The count returned will not reflect changes in related tables when cascade updates or deletes are in effect.
Parameters
NumberAffected The number of records affected.
1 if handle not initialized, -2 if Error.
qdHdl Handle of the QueryDef object
QDHandle |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
NumberAffected |
QDHandle |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to determine whether the Handle is currently open on a querydef.
Parameters
IsOpen Nonzero if the CDaoQueryDef object specified by hdl is currently open;
otherwise: -1 if Handle not initialized, -2 if Error.
qdHdl Handle of the QueryDef object
QDHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
IsOpen |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
This function is the constructor of the Query Def object, returning its Handle
Parameters
qdHdl Handle of the QueryDef object
dbHdl Handle of the Database object
DBHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
QDHandle |
DBHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to open a querydef previously saved in the database’s QueryDefs collection.
Once the querydef is open, you can call the QDExecute function with its handle or use the querydef to create a CDaoRecordset object.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Name A string that contains the name of the saved querydef to open.
QDHandle in |
Name |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function to set the querydef object’s connect string. The connect string is used to pass additional information to ODBC and certain ISAM drivers as needed. It is not used for Microsoft Jet (.MDB) databases.
Tip: The preferred way to work with ODBC tables is to attach them to an .MDB database.
Before executing a querydef that represents an SQL pass-through query to an ODBC data source, set the connect string with QDSetConnect and call QDSetReturnsRecords to specify whether the query returns records.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Connect A string that contains a connect string of the CDaoDatabase object
specified by he handle.
QDHandle in |
Connect |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function if you want to change the name of a querydef that is not temporary. Querydef names are unique, user-defined names.
You can call QDSetName before the querydef object is appended to the QueryDefs collection.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Name A string that contains the new name for a nontemporary query in the
CDaoDatabase object specified by the given handle.
QDHandle in |
Name |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to set the time limit before a query to an ODBC data source times out.
Tip: The preferred way to work with ODBC tables is to attach them to a Microsoft Jet (.MDB) database.
This 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.)
The default value for query timeouts is 60 seconds.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
ODBCTimeout The number of seconds before a query times out.
QDHandle in |
ODBCTimeout (sec) |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to set the value of the specified parameter at run time. The parameter must already have been established as part of the querydef’s SQL string.
Using this function, You can access the parameter by its ordinal position in the collection. For accessing it by name, You have to use QDSetParamValueByName.
Specify the value to set as a COleVariant object. For information about setting the desired value and type in your COleVariant object, see the OV...-Functions (Ole Variant)
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Index The zero-based index of the desired parameter in the querydef’s Parameters collection.
ovHdl A handle of a COleVariant object that contain the parameter’s value as it will be set.
QDHandle |
Index |
OVHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
OVHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to set the value of the specified parameter at run time. The parameter must already have been established as part of the querydef’s SQL string.
Using this function, You can access the parameter by its name. For accessing it by ordinal position in the collection, You have to use QDSetParamValueByIdx.
Specify the value to set as a COleVariant object. For information about setting the desired value and type in your COleVariant object, see the OV...-Functions (Ole Variant)
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
Name The name of the parameter whose value you want to set
ovHdl A handle of a COleVariant object that contain the parameter’s value as it will be set.
QDHandle |
Name |
OVHandle in |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle |
OVHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this function as part of the process of setting up an SQL pass-through query to an external database.
In such a case, you must create the querydef and set its properties using other QD...-Functions.
For a description of external databases, see QDSetConnect.
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
ReturnsRecords Pass TRUE if the query on an external database returns records;
otherwise, FALSE
QDHandle in |
Records |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Call this member function to set the SQL statement that the querydef executes.
A typical use of SetSQL is setting up a querydef object for use in an SQL pass-through query. (For the syntax of SQL pass-through queries on your target DBMS, see the documentation for your DBMS.)
Parameters
error Errorcode of this operation: -1 if handle not initialized, 1 if function
works correct, -2 if Error.
qdHdl Handle of the QueryDef object
SQLStatement A string containing a complete SQL statement, suitable for execution.
The syntax of this string depends on the DBMS that your query targets.
QDHandle in |
SQLStatement |
error in (no error) The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
FResult |
QDHandle out |
error out The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
status The status boolean is either TRUE (X) for an error, or FALSE (checkmark) for no error or a warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
code The code input identifies the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
source The source string describes the origin of the error or warning. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |