ConnectOption database parameter
Description
Sets driver-specific connection options when you are accessing
an ODBC data source in PowerBuilder. These options specify the following:
-
How the ODBC driver
prompts for additional connection information -
What type of security to use for a Microsoft SQL Server connection
-
Whether the ODBC Driver Manager Trace is on or off
and what trace file it uses -
Whether cursors are closed or left open on a SQLTransact call
-
How temporary stored procedures are treated for
a SQLPrepare call
Certain ConnectOption parameters apply to all ODBC drivers,
whereas others apply only to particular ODBC drivers.
For information on each ConnectOption parameter
and whether you can use it with your ODBC driver, see the table
in the Syntax section.

You must specify the ConnectOption parameter before connecting
to an ODBC data source. The ConnectOption settings take effect when
you connect to the database.
Controls
-
ODBC (if driver and
back-end DBMS support this feature)
Syntax
1 |
ConnectOption=' SQL_DRIVER_CONNECT,<span>value</span>; <br> SQL_INTEGRATED_SECURITY,<span>value</span>;<br> SQL_OPT_TRACE,<span>value</span>; <br> SQL_OPT_TRACEFILE,<span>value</span>;<br> SQL_PRESERVE_CURSORS,<span>value</span>;<br> SQL_USE_PROCEDURE_FOR_PREPARE,<span>value</span> ' |
The following table lists the applicable ODBC drivers, purpose,
and values for each ConnectOption parameter.
Parameter |
Description |
---|---|
SQL_DRIVER_CONNECT |
Driver Any ODBC driver that supports the SQLDriverConnect API Purpose Specifies how the ODBC driver prompts for additional connection Values The values you can specify are:
|
SQL_INTEGRATED_ SECURITY |
Driver Microsoft SQL Server ODBC Purpose Specifies the type of connection to the Microsoft SQL Server database server. Values The values you can specify are:
For more about security mechanisms in Microsoft SQL Server, see the Microsoft documentation. |
SQL_OPT_TRACE |
Driver Any ODBC driver. Purpose Turns on or turns off the ODBC Driver Manager Trace in PowerBuilder to Values The values you can specify are:
For instructions on using the ODBC Driver |
SQL_OPT_TRACEFILE |
Driver Any ODBC driver. Purpose Specifies the name of the trace file where you want PowerBuilder to Values You can specify any filename for the trace file, following |
SQL_PRESERVE_ CURSORS |
Driver Microsoft SQL Server ODBC Purpose Specifies whether cursors are closed or left open on a SQLTransact call. Values The values you can specify are:
|
SQL_USE_PROCEDURE_ FOR_PREPARE |
Driver Microsoft SQL Server ODBC Purpose Specifies how temporary stored procedures are treated for Values The values you can specify are:
|
Default
ConnectOption=’SQL_DRIVER_CONNECT, SQL_DRIVER_COMPLETE;
SQL_INTEGRATED_SECURITY,SQL_IS_OFF;
SQL_OPT_TRACE,SQL_OPT_TRACE_OFF;
SQL_PRESERVE_CURSORS,SQL_PC_OFF;
SQL_USE_PROCEDURE_FOR_PREPARE,SQL_UP_ON‘
Usage
Microsoft Server ODBC driver
The ConnectOption parameter applies only if you are accessing
a SQL Server database with the
Microsoft ODBC SQL Server driver.
You must obtain the Microsoft SQL Server
ODBC driver from Microsoft Corporation. This driver is not supplied
with PowerBuilder.
Examples
To specify nondefault options for the ConnectOption
parameter:
-
Database
profileComplete the Options page in the Database Profile Setup –
ODBC dialog box. Each ConnectOption parameter corresponds to an
option in the dialog box, as follows:ConnectOption parameter
Corresponding option
SQL_DRIVER_CONNECT
Connect Type
SQL_INTEGRATED_SECURITY
Integrated Security
SQL_OPT_TRACE
Trace ODBC API Calls
SQL_OPT_TRACEFILE
Trace File
SQL_PRESERVE_CURSORS
Preserve Cursors
SQL_USE_PROCEDURE_FOR_PREPARE
Use Procedure for Prepare
-
Application
Type the following in code:
1SQLCA.DbParameter="ConnectOption ='SQL_DRIVER_CONNECT,<br>SQL_DRIVER_NOPROMPT;SQL_INTEGRATED_SECURITY,<br>SQL_IS_ON;SQL_OPT_TRACE,SQL_OPT_TRACE_ON;<br>SQL_OPT_TRACEFILE,C:PBodbctrce.log;<br>SQL_PRESERVE_CURSORS,SQL_PC_ON;<br>SQL_USE_PROCEDURE_FOR_PREPARE,SQL_UP_OFF'"