DBOpenConnection

LabWindows/CVI SQL Toolkit 2.3 Help

Edition Date: August 2015

Part Number: 370502D-01

»View Product Info
Download Help (Windows Only)

int DBOpenConnection (int connectionHandle);

Purpose

Opens an existing but closed connection. Unlike DBConnect, DBOpenConnection, in conjunction with DBNewConnection, allows you to set connection attributes before opening the connection.

Example

hdbc = DBNewConnection();

resCode = DBSetConnectionAttribute (hdbc,

ATTR_DB_CONN_CONNECTION_STRING, "DatabaseDSN");

resCode = DBSetConnectionAttribute (hdbc,

ATTR_DB_CONN_CONNECTION_TIMEOUT, 100);

resCode = DBSetConnectionAttribute (hdbc,

ATTR_DB_CONN_ISOLATION_LEVEL, DB_ISOLATION_LEVEL_SERIALIZABLE);

resCode = DBOpenConnection (hdbc);

...

resCode = DBCloseConnection (hdbc);

resCode = DBDiscardConnection (hdbc);

Parameters

Input
Name Type Description
connectionHandle int Connection handle that DBNewConnection returned. If the connection is already open, this function returns an error.

Return Value

Name Type Description
resultCode int Result code that DBOpenSQLStatement returns. This function returns the set of result codes listed in the LabWindows/CVI SQL Toolkit Error Codes topic in the LabWindows/CVI SQL Toolkit Help. Use DBErrorMessage to obtain the text of the error message.

WAS THIS ARTICLE HELPFUL?

Not Helpful