Using connection parameters

Table 2-1 lists the connection parameters other than from the DSN parameter that can be supplied to the Adaptive Server ODBC Driver.

Table 2-1: Connection parameters

Property names

Description

Required

Default value

AlternateServers

A list of comma-separated host:port pairs such as server1:port1,server2:port2,...,serverN:portN; When establishing a connection, the Adaptive Server ODBC Driver first connects to the host and port specified by the Server and Port properties before going through the list of hosts and ports listed in AlternateServers.

See “Supported Adaptive Server Cluster Edition features” for information about how AlternateServers is used in a high availability environment.

No

Empty

AnsiNull

Strict ODBC compliance where you cannot use “= NULL.” Instead, you must use “IsNull.”

No

1

ApplicationName

The name used by Adaptive Server to identify the client application.

No

Empty

AuthenticationClient

The type of client library to be used for Kerberos Authentication. Valid values include:

  • activedirectory

  • cybersafekerberos

  • mitkerberos

No

Empty

AutoCommit

Set the autocommit state. Valid values are:

  • 0 – autocommit is off (equivalent to setting SQL_ATTR_AUTOCOMMIT to SQL_AUTOCOMMIT_OFF)

  • 1 – (default) autocommit is on (equivalent to setting SQL_ATTR_AUTOCOMMIT to SQL_AUTOCOMMIT_ON)

No

1

BackEndType

Specifies the target type of the datasource you are defining. The Adaptive Server ODBC Driver can communicate with multiple target objects, including database systems such as Adaptive Server, and gateways to non-Sybase database systems. Valid values include:

  • ASE

  • DC DB2 Access Service

  • DC TRS

  • MFC Gatewayless

  • Replication Server

See “Support for Mainframe Connect and DirectConnect for z/OS Option” for more information.

No

ASE

BufferCacheSize

Keeps the input / output buffers in pool. When large results will occur, increase this value to boost performance.

No

20

ChangeBigIntDefault

Specifies the default C type for bigint columns. Valid values are:

  • 0 – SQL_C_SBIGINT/SQL_CUBIGINT

  • 1 – SQL_C_CHAR

  • 2 – SQL_C_WCHAR

No

0

CharSet

Specifies the character set that is used to communicate to Adaptive Server. The valid values are ServerDefault, ClientDefault, NoConversions.

See “Character sets”.

No

ServerDefault

ClientCharset

Specifies the client character set.

See “Character sets”.

No

The character set currently used by the operating system.

ClientHostName

The name of the client host passed in the login record to the server.

No

Empty

ClientHostProc

The identity of client process on this host machine passed in the login record to the server.

No

Empty

CodePageType

Specifies the type of character encoding used. The valid values are ANSI, OEM, and Other.

No

ANSI

CommandTimeOut

The time, in seconds, that a client has to wait for a command to execute. If a command does not execute within the time given, the client cancels the command and generates an error.

No

0. A value of 0 indicates no time limit, allowing client to execute a command indefinitely its until return.

ConnectionTimeOut

The time, in seconds, that a client has to wait to establish a connection. If a connection is not established within the time given, the client cancels the attempt and generates an error.

No

0. A value of 0 indicates no time limit, allowing ODBC to wait indefinitely for a database connection to be established.

CRC

By default, the driver returns the total records updated when multiple update statements are executed in a stored procedure. This count will also include all updates happening as part of the triggers set on an update or an insert.

Set this property to 0 if you want the driver to return only the last update count.

No

1

Database

The database to which you want to connect.

No

Empty

DataIntegrity

Enables Kerberos Data Integrity.

No

0 (disabled)

DistributedTransaction Protocol

Sets the protocol to be used for distributed transactions. Valid values are XA (default) and OLE.

No

XA

DSPassword

The password used to authenticate on the LDAP server, if the LDAP server does not allow anonymous access. The password can be specified in the Directory Service URL (DSURL) as well.

No

Empty

DSPrincipal

The user name used to authenticate on the LDAP server, if the LDAP server does not allow anonymous access. The principal can be specified in the DSURL as well.

No

Empty

DSURL

The URL to the LDAP server.

No

Empty

DTCProtocol (Microsoft Windows only)

Allows the driver to use either an XA protocol or OleNative protocol when using distributed transactions. See “Using distributed transactions”, in Chapter 3, “Supported Adaptive Server Features.”

No

XA

DynamicPrepare

When set to 1, the driver sends SQLPrepare calls to Adaptive Server to compile/prepare. This can boost performance if you use the same query repeatedly.

No

0

EnableBulkLoad

Specifies whether bulk-load support is enabled:

  • 0 – bulk-load support is disabled.

  • 1 – bulk-load using array insert is enabled.

  • 2 – bulk-load using the bulk copy interface is enabled.

  • 3 – bulk-load using the fast logged bulk copy interface is enabled.

See “Bulk-load support”.

Use the Sybase-specific SQL_ATTR_ENABLE_BULK_LOAD connection attribute to set EnableBulkLoad programmatically. The attribute accepts the same values as EnableBulkLoad.

Yes

0

EnableLOBLocator

Specifies whether large object (LOB) locator support is enabled:

  • 0 – LOB locator support is disabled.

  • 1 – LOB locator support is enabled.

See “Large Object (LOB) locator support”.

No

0

EnableMDACheck

Sets the checking mode for MDA scripts installed on the server. Valid values are:

  • 0 – disables MDA script checking.

  • 1 – raise warning if the MDA script version is older than the driver version and continue with the connection.

  • 2 – raise error if the MDA script version is older than the driver version and fail the connection.

No

0

EnableServerPacketSize

Allows Adaptive Server server versions 15.0 or later to choose the optimal packet size.

No

1

Encryption

The designated encryption. Possible values: ssl.

No

Empty

EncryptPassword

Specifies whether password is transmitted in an encrypted format:

  • 0 – use plain text password.

  • 1 – use encrypted password. If it is not supported, return an error message.

  • 2 – use encrypted password. If it is not supported, use plain text password.

NoteWhen password encryption is enabled, and the server supports asymmetric encryption, this format is used instead of symmetric encryption.

No

0

Escape

Sets the ODBC escape character.

No

‘\’

FetchArraySize

Specifies the number of rows the driver retrieves when fetching results from the server.

No

25

HASession

Specifies if high availability is enabled. 0 indicates high availability disabled, 1 high availability enabled.

No

0

HomogeneousBatch

Specifies the parameter batch handling mode:

  • 0 – disables parameter batching.

  • 1 – enables Adaptive Server parameter batching protocol.

  • 2 – enables Adaptive Server bulk insert protocol.

Use the Sybase-specific SQL_ATTR_HOMOGENEOUS_BATCH connection attribute to set HomogeneousBatch programmatically. The attribute accepts the same values as HomogeneousBatch.

No

0

IgnoreErrorsIfRS Pending

Specifies whether the driver is to continue processing or stop if error messages are present. When set to 1, the driver ignores errors and continues processing the results if more results are available from the server. When set to 0, the driver stops processing the results if an error is encountered even if there are results pending

No

0

InitializationString

Sets a Transact-SQL statement to be executed at login.

No

Empty

Isolation

Specified the initial isolation level for the connection. Valid values are:

  • 0 – read uncommitted

  • 1 – read committed

  • 2 – repeatable read

  • 3 – serializable

No

0

Language

The language in which Adaptive Server returns error messages.

No

Empty – Adaptive Server uses English by default

LoginTimeOut

Number of seconds to wait for a login attempt before returning to the application. If set to 0, the timeout is disabled, and a connection attempt waits for an indefinite period of time.

No

15

NormalizeWCharParams

Specifies whether to enable Unicode string normalization. Set this property to 1 when the Adaptive Server configuration option enable unicode normalization is set to 0. Valid values are:

  • 0 – disables Unicode string normalization.

  • 1 – enables Unicode string normalization.

No

0

OldPassword

The current password. If OldPassword contains a value that is not null or an empty string, the current password is changed to the value contained in PWD.

No

Empty

PacketSize

The number of bytes per network packet transferred between Adaptive Server and the client.

No

Server-determined when driver is connected to Adaptive Server 15.0 or later. For older versions, the default is 512.

ParamsetsBeforeThread

Specifies the number of parameter sets to send before starting the response thread during a batch operation.

No

50

Port

The port number of Adaptive Server.

Yes

Empty

ProgName

Sets the value of progname to be used during login.

The specified value is truncated to 30 characters.

No

Empty

ProtocolCapture

Enable this property to capture TDS packets exchanged between an ODBC application and the server for debugging purposes. This property is enabled by specifying the capture file prefix.

See “TDS protocol capture”.

No

Empty

PWD, Password

Contains the value of the password. When performing a normal login, OldPassword is not set and PWD contains the value of the current password. When changing the password, OldPassword is set to the current password, and PWD contains the value of the new password.

No, if the user name does not require a password

Empty

QuotedIdentifier

Specifies if Adaptive Server treats character strings enclosed in double quotes as identifiers:

  • 0 – does not enable quoted identifiers.

  • 1 – enables quoted identifiers.

No

0

ReadWriteUnknown

When set, the columns are not updatable are marked as read/write unknown.

No

0

ReleaseLocksOnCursorClose

Specifies if Adaptive Server releases shared read-only cursor locks at isolation levels 2 and 3 when a cursor is closed:

  • 0 – does not enable shared cursor locks release on close.

  • 1 – enables shared cursor locks release on close.

No

0

RemotePwd

Sets the remote password(s) for servers in servername,password;servername,password;... format.

No

Empty

ReplayDetection

Enables Kerberos Replay Detection.

No

0

RestrictMaximum PacketSize

If there are memory constraints when EnableServerPacketSize is set to 1, set this property to an int value in multiples of 512 to a maximum of 65536.

No

0

RetryCount, RetryDelay

Control the connection retry behavior.

RetryCount is the number of times to attempt to connect to the server before reporting the connection failed. Between each retry, the driver delays for RetryDelay number of seconds.

By default, the ODBC application does not retry the connection.

No

0

SecondaryPort

The port number of the Adaptive Server acting as a failover server in an active-active or active-passive setup.

Yes, if HASession is set to 1.

Empty

SecondaryServer

The name or the IP address of the Adaptive Server acting as a failover server in an active-active or active-passive setup.

Yes, if HASession is set to 1.

Empty

Server

The name or IP address of the Adaptive Server.

Yes

Empty

ServerInitiated Transactions

When SQL_ATTR_AUTOCOMMIT is set to 1, Adaptive Server starts managing transactions as needed. The driver issues a set chained on command on the connection. Older ODBC drivers do not use this feature and manage the job of starting transactions by calling begin tran. Set this property to 0 to maintain the old behavior or require that your connection not use “chained” transaction mode.

No

1

ServerPrincipal

The logical name or the principal Adaptive Server name as configured in the Key Distribution Center (KDC). Adaptive Server ODBC Driver uses the information to negotiate Kerberos authentication with the configured KDC and Adaptive Server.

No

Empty

ServiceName

Specifies the service name used to connect to the host. ServiceName can hold any string value.

See “Support for Mainframe Connect and DirectConnect for z/OS Option”.

No

Empty

SuppressParamFormat

Specifies that Adaptive Server is to suppress parameter format metadata when prepared statements are re-executed in a session.

Values:

  • 0 – the parameter format metadata is not suppressed.

  • 1– the default value; Adaptive Server will not send parameter format metadata where possible.

See “Suppressing parameter format metadata”.

No

1

SuppressRowFormat

Specifies that Adaptive Server is to suppress row format metadata (TDS_ROWFMT or TDS_ROWFMT2) for queries that are re-executed in a session.

Values:

  • 0 – the row format metadata is not suppressed.

  • 1– the default value; Adaptive Server will not send row format metadata where possible.

See “Suppressing row format metadata”.

No

1

SuppressRowFormat2

Specifies that Adaptive Server is to send data using the TDS_ROWFMT byte sequence where possible instead of the TDS_ROWFMT2 byte sequence.

Values:

  • 0 – the default value; TDS_ROWFMT2 is not suppressed.

  • 1– forces the server to send data in TDS_ROWFMT where possible.

See “Suppressing additional row format information”.

No

0

SupressTDSControl Tokens

When set, the server does not send TDS control tokens.

No

0

TextSize

The maximum size of binary or text data that can be sent over the wire.

No

Empty – Adaptive Server default is 32K.

TightlyCoupled Transaction (Microsoft Windows only)

When using distributed transactions, if you are using two DSNs that connect to the same Adaptive Server, set this to 1. See “Using distributed transactions”, in Chapter 3, “Supported Adaptive Server Features.”

No

0

TrustedFile

If encryption is set to ssl, set this property to the path to the Trusted File.

No

Empty

UID, UserID

A case-sensitive user ID required to connect to the Adaptive Server.

Yes

Empty

UseCursor

Specifies which cursor type is to be used for SQL statements that generate result sets.

  • 0 – use server-side cursors for all cases.

  • 1 – use client-side cursors for all cases.

  • 2 – use server-side cursors only when SQLSetCursorName ODBC function is called.

See “UseCursor connection property”.

No

0