_XOnDAO2_QueryDefinition_VIs.vi

Description



QDAppend

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.


Connector Pane

QDAppend


Controls and Indicators

cdlrn

QDHandle

cclst

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.

idlrn

QDHandle

ii32

FResult

iclst

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.


QDClose

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


Connector Pane

QDClose


Controls and Indicators

cdlrn

QDHandle in

cclst

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.

idlrn

QDHandle out

iclst

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.


QDCreate

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.


Connector Pane

QDCreate


Controls and Indicators

cdlrn

QDHandle in

cstr

QueryName

cstr

SQLQueryString

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.


QDDeleteQD

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


Connector Pane

QDDeleteQD


Controls and Indicators

cdlrn

QDHandle

cclst

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.

iclst

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.


QDExecute

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.


Connector Pane

QDExecute


Controls and Indicators

cdlrn

QDHandle

ci32

Options

cclst

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.

idlrn

QDHandle

ii32

FResult

iclst

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.


QDGetFieldCount

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


Connector Pane

QDGetFieldCount


Controls and Indicators

cdlrn

QDHandle

cclst

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.

ii32

FieldCount

idlrn

QDHandle

iclst

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.


QDGetFieldInfoByIdx

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.


Connector Pane

QDGetFieldInfoByIdx


Controls and Indicators

cdlrn

QDHandle

cdlrn

FIHandle in

ci32

Index

cclst

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.

ii32

FResult

idlrn

QDHandle

idlrn

FIHandle out

iclst

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.


QDGetFieldInfoByName

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.


Connector Pane

QDGetFieldInfoByName


Controls and Indicators

cdlrn

QDHandle

cdlrn

FIHandle out

cstr

Name

cclst

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.

ii32

FResult

idlrn

QDHandle

idlrn

FIHandle out

iclst

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.


QDGetParameterCount

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


Connector Pane

QDGetParameterCount


Controls and Indicators

cdlrn

QDHandle

cclst

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.

ii32

NumberParameter

idlrn

QDHandle

iclst

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.


QDGetParameterInfoByIdx

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.


Connector Pane

QDGetParameterInfoByIdx


Controls and Indicators

cdlrn

QDHandle

ci32

Index

cclst

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.

ii32

FResult

idlrn

QDHandle

iclst

ParameterInfo

iclst

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.


QDGetParameterInfoByName

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


Connector Pane

QDGetParameterInfoByName


Controls and Indicators

cdlrn

QDHandle

cstr

Name

cclst

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.

ii32

FResult

idlrn

QDHandle

iclst

ParameterInfo

iclst

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.


QDGetParamValueByIdx

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.


Connector Pane

QDGetParamValueByIdx


Controls and Indicators

cdlrn

QDHandle

ci32

Index

cdlrn

OVHandle in

cclst

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.

ii32

FResult

idlrn

QDHandle

idlrn

OVHandle out

iclst

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.


QDGetParamValueByName

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.


Connector Pane

QDGetParamValueByName


Controls and Indicators

cdlrn

QDHandle

cstr

Name

cdlrn

OVHandle in

cclst

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.

ii32

FResult

idlrn

QDHandle

idlrn

OVHandle out

iclst

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.


QDGetQueryDefInfo


Connector Pane

QDGetQueryDefInfo


Controls and Indicators

cdlrn

QDHandle

cclst

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.

idlrn

QDHandle

iclst

QueryDefInfo

ii32

FResult

iclst

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.


QDGetRecordsAffected

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


Connector Pane

QDGetRecordsAffected


Controls and Indicators

cdlrn

QDHandle

cclst

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.

ii32

NumberAffected

idlrn

QDHandle

iclst

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.


QDIsOpen

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


Connector Pane

QDIsOpen


Controls and Indicators

cdlrn

QDHandle in

cclst

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.

ibool

IsOpen

idlrn

QDHandle out

iclst

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.


QDNewQD

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


Connector Pane

QDNewQD


Controls and Indicators

cdlrn

DBHandle in

cclst

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.

idlrn

QDHandle

idlrn

DBHandle out

iclst

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.


QDOpen

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.


Connector Pane

QDOpen


Controls and Indicators

cdlrn

QDHandle in

cstr

Name

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.


QDSetConnect

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.


Connector Pane

QDSetConnect


Controls and Indicators

cdlrn

QDHandle in

cstr

Connect

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.


QDSetName

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.


Connector Pane

QDSetName


Controls and Indicators

cdlrn

QDHandle in

cstr

Name

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.


QDSetODBCTimeout

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.


Connector Pane

QDSetODBCTimeout


Controls and Indicators

cdlrn

QDHandle in

ci32

ODBCTimeout (sec)

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.


QDSetParamValueByIdx

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.


Connector Pane

QDSetParamValueByIdx


Controls and Indicators

cdlrn

QDHandle

ci32

Index

cdlrn

OVHandle in

cclst

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.

ii32

FResult

idlrn

QDHandle

idlrn

OVHandle out

iclst

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.


QDSetParamValueByName

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.


Connector Pane

QDSetParamValueByName


Controls and Indicators

cdlrn

QDHandle

cstr

Name

cdlrn

OVHandle in

cclst

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.

ii32

FResult

idlrn

QDHandle

idlrn

OVHandle out

iclst

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.


QDSetReturnsRecords

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


Connector Pane

QDSetReturnsRecords


Controls and Indicators

cdlrn

QDHandle in

ci32

Records

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.


QDSetSQL

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.


Connector Pane

QDSetSQL


Controls and Indicators

cdlrn

QDHandle in

cstr

SQLStatement

cclst

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.

ii32

FResult

idlrn

QDHandle out

iclst

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.