_XOnDAO2_DataBase_VIs.vi

Description

Use the Database Library to manipulate an open database. In any type of database, you can:

With a Microsoft Jet database (.mdb file), you can also use other methods, properties, and collections to manipulate aDatabase, as well as create, modify, or get information about its tables, queries, and relationships. For example, you can: In an ODBC workspace, you can use the Connection property to obtain a reference to the Connection object that corresponds to the Database object. Use the CreateDatabase method to create a persistent Database object that is automatically appended to the Databases collection, thereby saving it to disk. You don't need to specify the DBEngine object when you use the OpenDatabase method. Opening a database with linked tables doesn't automatically establish links to the specified external files or Microsoft Jet-connected ODBC data sources. You must either reference the table's TableDef or Field objects or open a Recordset object. If you can't establish links to these tables, a trappable error occurs. You may also need permission to access the database, or another user might have the database opened exclusively. In these cases, trappable errors occur. You can also use the OpenDatabase method to open an external database (such as Microsoft Visual FoxPro, dBASE, and Paradox) directly instead of opening a Microsoft Jet database that has links to its tables. Note: Opening a Database object directly on a Microsoft Jet-connected ODBC data source, such as Microsoft SQL Server, is not recommended because query performance is much slower than when using linked tables. However, performance is not a problem with opening a Database object directly on an external ISAM database file, such as Visual FoxPro, Paradox, and so forth. When a procedure that declares a Database object has executed, local Database objects are closed along with any open Recordset objects. Any pending updates are lost and any pending transactions are rolled back, but no trappable error occurs. You should explicitly complete any pending transactions or edits and close Recordset objects and Database objects before exiting procedures that declare these object variables locally. When you use one of the transaction methods (BeginTrans, CommitTrans, or Rollback) on the Workspace object, these transactions apply to all databases opened on the Workspace from which the Database object was opened. If you want to use independent transactions, you must first open an additional Workspace object, and then open another Database object in that Workspace object. Note You can open the same data source or database more than once, creating duplicate names in the Databases collection. To avoid confusion, assign Database objects to object variables and refer to them by variable name.



DBCanTransact

Call this function to determine whether the database allows transactions. Transactions are managed in the database's workspace.

Parameters

DBHandle in- Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

Result - TRUE if the database supports transactions; otherwise FALSE.

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

DBCanTransact


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.

ibool

DBCanTransact

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.


DBCanUpdate

Call this function to determine whether the Database allows updates.

Parameters

DBHandle in- Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Result - TRUE if the Database allows updates; otherwise FALSE, indicating either that you passed TRUE in bReadOnly when you opened the Database or that the database itself is read-only. See the Open function.

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

DBCanUpdate


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.

ibool

DBCanUpdate

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.


DBClose

Call this function to disconnect from a database and close any open recordsets, tabledefs, and querydefs associated with the database. It is good practice to close these objects yourself before you call this function. Closing a Database object removes it from the Databases collection in the associated workspace. Because Close does not destroy the Database object, you can reuse the object by opening the same database or a different database.

Parameters

DBHandle in - Handle of the Database (input)

DBHandle out - Handle of the Database (output)

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

Caution

Call the Update function (if there are pending edits) and the Close function on all open recordset objects before you close a database. If you exit a function that declares Recordset or Database objects on the stack, the database is closed, any unsaved changes are lost, all pending transactions are rolled back, and any pending edits to your data are lost.

Caution

If you try to close a database object while any recordset objects are open, or if you try to close a workspace object while any database objects belonging to that specific workspace are open, those recordset objects will be closed and any pending updates or edits will be rolled back. If you try to close a workspace object while any database objects belonging to it are open, the operation closes all database objects belonging to that specific workspace object, which may result in unclosed recordset objects being closed.

If the database object is defined outside the scope of a function, and you exit the function without closing it, the database object will remain open until explicitly closed or the module in which it is defined is out of scope.

XOn Software GmbH


Connector Pane

DBClose


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

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.


DBCreate

To create a new Microsoft Jet (.MDB) database, call this function after you construct a Database Handle. Create creates the database file and the underlying DAO database object and initializes the C++ object. The object is appended to the associated workspace's Databases collection. The database object is in an open state; do not call Open after Create.

Note

With Create, you can create only Microsoft Jet (.MDB) databases. You cannot create ISAM databases or ODBC databases.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

lpszName - A string expression that is the name of the database file that you are creating. It can be the full path and filename, such as "C:\\MYDB.MDB". You must supply a name. If you do not supply a filename extension, .MDB is appended. If your network supports the uniform naming convention (UNC), you can also specify a network path, such as

"\\MYSERVER\MYSHARE\MYDIR\MYDB". Only Microsoft Jet (.MDB) database files can

be created using this function.

LpszLocale - A integer expression used to specify collating order for creating the database. The default value is „General“.

DwOptions - An integer that indicates one or more options. Possible values are:

1 Create a database with Microsoft Jet database version 1.0.

2 Create an encrypted database.

8 Create a database with Microsoft Jet database version 1.1.

16 Create a database with Microsoft Jet database version 2.0.

32 Create a database with Microsoft Jet database version 3.0.

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

DBCreate


Controls and Indicators

cdlrn

DBHandle in

cstr

Name

cenum

Lang(General)

c1di32

XLLang

ci32

Options(0)

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

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.


DBCreateRelation

Call this function to establish a relation between one or more fields in a primary table in the database and one or more fields in a foreign table (another table in the database). The relationship cannot involve a query or an attached table from an external database.

Use the first version of the function when the relation involves one field in each of the two tables. Use the second version when the relation involves multiple fields. The maximum number of fields in a relation is 14.

If you set the relation attributes to activate cascade operations, the database engine automatically updates or deletes records in one or more other tables when changes are made to related primary key tables.

For example, suppose you establish a cascade delete relationship between a Customers table and an Orders table. When you delete records from the Customers table, records in the Orders table related to that customer are also deleted. In addition, if you establish cascade delete relationships between the Orders table and other tables, records from those tables are automatically deleted when you delete records from the Customers table.

Parameters

DBHandle in- Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Name - The unique name of the relation. The name must start with a letter and can contain a maximum of 40 characters. It can include numbers and underscore characters but cannot include punctuation or spaces.

Table - The name of the primary table in the relation. If the table does not exist, MFC throws an exception of type CDaoException.

ForeignTable - The name of the foreign table in the relation. If the table does not exist, MFC throws an exception of type CDaoException.

Attributes - A long value that contains information about the relationship type. You can use this value to enforce referential integrity, among other things. You can use the bitwise-OR operator (|) to combine any of the following values (as long as the combination makes sense):

1 Relationship is one-to-one.

2 Relationship is not enforced (no referential integrity).

4 Relationship exists in a noncurrent database that contains the two

attached tables.

256 Updates will cascade (for more on cascades).

4096 Deletions will cascade.

Field - A pointer to a null-terminated string containing the name of a field in the primary table

(named by lpszTable).

ForeignField - A pointer to a null-terminated string containing the name of a field in the foreign table (named by lpszForeignTable).

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

DBCreateRelation


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.

cclst

Relation

ii32

FResult

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.


DBDeleteDB

This VI is Destructor of the Database Handle and returns the handle of the workspace used.

Parameters

DBHandle in - Handle of the Database (Input)

WSHandle out- Handle of the Workspace (Output)

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

DBDeleteDB


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

WSHandle 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.


DBDeleteQueryDef

Call this function to delete the specified querydef from the Database object’s QueryDefs collection. Afterwards, that query is no longer defined in the database.

Parameters

DBHandle in - Handle of the Database (input)

DBHandle out - Handle of the Database (output)

lpszName - The name of the saved query to delete.

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

DBDeleteQueryDef


Controls and Indicators

cdlrn

DBHandle 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.

idlrn

DBHandle out

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.


DBDeleteRelation

Call this function to delete an existing relation from the database object’s Relations collection. Afterwards, the relation no longer exists.

For related information, see the topic Delete Method in DAO Help.

Parameters

DBHandle in - Handle of the Database (input)

DBHandle out - Handle of the Database (output)

lpszName - The name of the relation to delete.

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

DBDeleteRelation


Controls and Indicators

cdlrn

DBHandle 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.

idlrn

DBHandle out

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.


DBDeleteTableDef

Call this function to delete the specified table and all of its data from the Database object’s TableDefs collection. Afterwards, that table is no longer defined in the database.

Warning Be very careful not to delete system tables.

Parameters

DBHandle in Handle of the Database (input)

DBHandle out Handle of the Database (output)

lpszName The name of the tabledef to delete.

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


Connector Pane

DBDeleteTableDef


Controls and Indicators

cdlrn

DBHandle 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.

idlrn

DBHandle out

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.


DBExecute

Call this function to run an action query or execute an SQL statement on the database. Execute works only for action queries or SQL pass-through queries that do not return results. It does not work for select queries, which return records.

Parameters

DBHandle in Handle of the Database (Input)

DBHandle out Handle of the Database (Output)

lpszSQL Pointer to a null-terminated string containing a valid SQL command to execute.

Noptions An integer that specifies options relating to the integrity of the query

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

DBExecute


Controls and Indicators

cdlrn

DBHandle in

cstr

SQL

ci32

Options(0)

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

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.


DBGetConnect

Call this function to retrieve the connect string used to connect to an ODBC or ISAM database. The string provides information about the source of an open database or a database used in a pass-through query. The connect string is composed of a database type specifier and zero or more parameters separated by semicolons.

DBHandle in- Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Connect - The connect string if Open has been called successfully on an ODBC data source; otherwise, an empty string. For a Microsoft Jet (.MDB) database, the string is always empty unless you set it for use with the dbSQLPassThrough option used with the Execute function or used in opening a recordset.

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

DBGetConnect


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.

ci32

Length

ii32

FResult

idlrn

DBHandle out

istr

Connect

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.


DBGetName

Call this function to retrieve the name of the currently open database, which is the name of an existing database file or registered ODBC data source name. If your network supports the uniform naming convention (UNC), you can also specify a network path, such as "\\MYSERVER\MYSHARE\MYDIR\MYDB.MDB".

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Name - The full path and filename for the database if successful; otherwise, an empty String.

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

DBGetName


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.

ii32

FResult

idlrn

DBHandle out

istr

Name

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.


DBGetQueryDefCount

Call this function to retrieve the number of queries defined in the database's QueryDefs collection. GetQueryDefCount is useful if you need to loop through all querydefs in the QueryDefs collection.

Parameters

DBHandle in Handle of the Database (Input)

DBHandle out Handle of the Database (Output)

Count The number of queries defined in the database.

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

DBGetQueryDefCount


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.

ii32

FResult

idlrn

DBHandle out

ii32

QDCount

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.


DBGetQueryDefInfoByIdx

Call this function to obtain various kinds of information about a query defined in the database.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

nIndex - The index of the predefined query in the database's QueryDefs collection.

Querydefinfo A Cluster containing the information requested.

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

DBGetQueryDefInfoByIdx


Controls and Indicators

cdlrn

DBHandle in

ci32

Index(0)

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

DBHandle out

iclst

QueryDefInfo

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.


DBGetQueryDefInfoByName

Call this function to obtain various kinds of information about a query defined in the database.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Name - A string containing the name of a query defined in the database.

Querydefinfo - A Cluster containing the information requested.

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

DBGetQueryDefInfoByName


Controls and Indicators

cdlrn

DBHandle 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

DBHandle out

iclst

QueryDefInfo

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.


DBGetQueryTimeout

Call this function to retrieve the current number of seconds to allow before subsequent operations on the connected database are timed out. An operation might time out due to network access problems, excessive query processing time, and so on. While the setting is in effect, it affects all open, add new, update, and delete operations on any recordsets associated with this Database. You can change the current timeout setting by calling SetQueryTimeout. Changing the query timeout value for a recordset after opening does not change the value for the recordset. For example, subsequent Move operations do not use the new value. The default value is initially set when the database engine is initialized.

The default value for query timeouts is taken from the Windows registry. If there is no registry setting, the default is 60 seconds. Not all databases support the ability to set a query timeout value. If you set a query timeout value of 0, no timeout occurs; and communication with the database may hang. This behavior may be useful during development.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

Timeout- A short integer containing the timeout value in seconds.

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

DBGetQueryTimeout


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.

ii32

FResult

idlrn

DBHandle out

ii32

QueryTimeout

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.


DBGetRecordsAffected

Call this function to determine the number of records affected by the most recent call of the Execute function. The value returned includes the number of records deleted, updated, or inserted by an action query run with Execute. The count returned will not reflect changes in related tables when cascade updates or deletes are in effect.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Records - A long integer containing the number of records affected.

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

DBGetRecordsAffected


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.

ii32

FResult

idlrn

DBHandle out

ii32

RecordsAffected

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.


DBGetRelationCount

Call this function to retrieve the number of queries defined in the database's QueryDefs collection. GetQueryDefCount is useful if you need to loop through all querydefs in the QueryDefs collection.

Parameters

DBHandle in Handle of the Database (Input)

DBHandle out Handle of the Database (Output)

Count The number of queries defined in the database.

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

DBGetRelationCount


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.

ii32

FResult

idlrn

DBHandle out

ii32

RelCount

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.


DBGetRelationFieldInfo

Call this function to obtain information about a specified field in a relation of the database's Relations collection.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

RelIndex - The index of the relation in the database's Relations collection.

FieldIndex - The index of the field in the selected Relation

FieldName - Name of the selected field

ForeignField - Das wüßte ich auch gern

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

DBGetRelationFieldInfo


Controls and Indicators

cdlrn

DBHandle in

ci32

RelIndex(0)

ci32

FieldIndex(0)

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

DBHandle out

istr

FieldName

istr

ForeignField

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.


DBGetRelationInfoByIdx

Call this function to obtain information about a specified relation in the database's Relations collection.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

nIndex - The index of the relation in the database's Relations collection.

Relinfo A reference to a CDaoRelationInfo object that returns the information requested.

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

DBGetRelationInfoByIdx


Controls and Indicators

cdlrn

DBHandle in

ci32

Index(0)

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

Result

idlrn

DBHandle out

iclst

RelationInfo

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.


DBGetRelationInfoByName

Call this function to obtain information about a specified relation in the database's Relations collection.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

Name - A string containing the name of the relation object, for lookup by name.

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

Relinfo - A reference to a CDaoRelationInfo object that returns the information requested.


Connector Pane

DBGetRelationInfoByName


Controls and Indicators

cdlrn

DBHandle 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

Result

idlrn

DBHandle out

iclst

RelationInfo

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.


DBGetTableDefCount

Call this function to retrieve the number of tables defined in the database. GetTableDefCount is useful if you need to loop through all tabledefs in the database’s TableDefs collection. To obtain information about a given table in the collection, see GetTableDefInfo.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out - Handle of the Database (Output)

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

Result - The number of tabledefs defined in the database.

XOn Software GmbH


Connector Pane

DBGetTableDefCount


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.

ii32

FResult

idlrn

DBHandle out

ii16

TDCount

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.


DBGetTableDefInfoByIdx

Call this function to obtain various kinds of information about a table defined in the database.

Parameters

DBHandle - in Handle of the Database (input)

DBHandle out - Handle of the Database (output)

nIndex - The index of the tabledef object in the database’s TableDefs collection

TIHDL in A Handle to a TableDefInfo object that returns the information requested.(Input)

TIHDL out- A Handle to a TableDefInfo object that returns the information requested.(Ouput)

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

DBGetTableDefInfoByIdx


Controls and Indicators

cdlrn

DBHandle in

cdlrn

TIHandle in

ci32

Index(0)

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

DBHandle out

idlrn

TIHandle 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.


DBGetTableDefInfoByName

Call this function to obtain various kinds of information about a table defined in the database.

Parameters

DBHandle in - Handle of the Database (input)

DBHandle out- Handle of the Database (output)

lpszName - The name of the tabledef object.

TIHDL in - A Handle to a TableDefInfo object that returns the information requested.(Input)

TIHDL out - A Handle to a TableDefInfo object that returns the information requested.(Ouput)

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

DBGetTableDefInfoByName


Controls and Indicators

cdlrn

DBHandle in

cdlrn

TIHandle 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

DBHandle out

idlrn

TIHandle 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.


DBGetVersion

Call this function to determine the version of the Microsoft Jet database file. The value returned represents the version number in the form "major.minor"; for example, "3.0". The product version number (for example, 3.0) consists of the version number (3), a period, and the release number (0). The versions to date are 1.0, 1.1, 2.0, and 3.0.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

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

Version - A String that indicates the version of the database file.

XOn Software GmbH


Connector Pane

DBGetVersion


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.

ci32

Numeric

ii32

Result

idlrn

DBHandle out

istr

DBVersion

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.


DBGetWorkspace

Call this function to determine the workspace the database is assoziated with.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

WS Handle - A Handle of the Workspace associated with the Database.

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

DBGetWorkspace


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

WSHandle 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.


DBNewDB

Constructs a CDaoDatabase object. After constructing the object, if you are creating a new Microsoft Jet (.MDB) database, call the Create function. If you are, instead, opening an existing database, call the Open function.

When you finish with the object, you should call the Close function and then destroy the DaoDatabase object.

Parameters

WSHandle- Handle of the Workspace you want to use for the database (Input)

DBHandle - Handle of the Database (Output)

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

DBNewDB


Controls and Indicators

cdlrn

WSHandle 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

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.


DBOpen

You must call this function to initialize a newly constructed Database object that represents an existing database. Open associates the database with the underlying DAO object. You cannot use the database object to construct recordset, tabledef, or querydef objects until it is initialized. Open appends the database object to the associated workspace’s Databases collection.

Important For better performance when accessing external databases, including ISAM databases and ODBC data sources, it is recommended that you attach external database tables to a Microsoft Jet engine database (.MDB) rather than connecting directly to the data source.

It is possible for a connection attempt to time out if, for example, the DBMS host is unavailable.

The remaining remarks apply only to ODBC databases:

If the database is an ODBC database and the parameters in your Open call do not contain enough information to make the connection, the ODBC driver opens a dialog box to obtain the necessary information from the user. When you call Open, your connect string, lpszConnect, is stored privately and is available by calling the GetConnect function.

Parameters

DBHandle in - Handle of the Database (input)

DBHandle out - Handle of the Database (output)

lpszName - A string expression that is the name of an existing Microsoft Jet (.MDB) database file. If the filename has an extension, it is required. If your network supports the uniform naming convention (UNC), you can also specify a network path, such as “\\MYSERVER\MYSHARE\MYDIR\\MYDB.MDB”. Is an empty string ("") and lpszConnect is “ODBC;”, a dialog box listing all registered ODBC data source names is displayed so the user can select a database. You should avoid direct connections to ODBC data sources; use an attached table instead. Otherwise does not refer to an existing database or valid ODBC data source name,

bExclusive - A Boolean value that is TRUE if the database is to be opened for exclusive (nonshared) access and FALSE if the database is to be opened for shared access. If you omit this argument, the database is opened for shared access.

bReadOnly - A Boolean value that is TRUE if the database is to be opened for read-only access and FALSE if the database is to be opened for read/write access. If you omit this argument, the database is opened for read/write access. All dependent recordsets inherit this attribute.

lpszConnect - A string expression used for opening the database. This string constitutes the ODBC connect arguments. You must supply the exclusive and read-only arguments to supply a source string. If the database is a Microsoft Jet database (.MDB), this string is empty ("").

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

DBOpen


Controls and Indicators

cdlrn

DBHandle in

cstr

DatabaseName (if mdb)

cbool

Exclusive(F)

cbool

ReadOnly(F)

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

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.


DBSetQueryTimeout

Call this function to override the default number of seconds to allow before subsequent operations on the connected database time out. An operation might time out due to network access problems, excessive query processing time, and so on. Call SetQueryTimeout prior to opening your recordset or prior to calling the recordset's AddNew, Update, or Delete functions if you want to change the query timeout value. The setting affects all subsequent Open, AddNew, Update, and Delete calls to any recordsets associated with this Database. Changing the query timeout value for a recordset after opening does not change the value for the recordset. For example, subsequent Move operations do not use the new value.

The default value for query timeouts is 60 seconds. Not all databases support the ability to set a query timeout value. If you set a query timeout value of 0, no timeout occurs; the communication with the database may hang. This behavior may be useful during development.

Parameters

DBHandle in - Handle of the Database (Input)

DBHandle out- Handle of the Database (Output)

Timeout - The number of seconds to allow before a query attempt times out. (Input)

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

DBSetQueryTimeout


Controls and Indicators

cdlrn

DBHandle in

ci32

Timeout

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

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.


DRelAttributes


Connector Pane

DRelAttributes


Controls and Indicators

cu32

Attributes in

c1denum

DRelAttributes in

iu32

Attributes

i1denum

DRelAttributes