2.4 Microsoft OLE DB Provider for SQL Server Connection String

A Microsoft OLE DB Provider for Microsoft SQL Server connection string is an OleDBConnectionString that has additional provider-specific keys allowed. For more information about the Microsoft OLE DB Provider for SQL Server, see [MSDN-SQLOLEDB]. The following table specifies the provider-specific keys for the Microsoft OLE DB Provider for SQL Server.

Key

Meaning

Application Name

Specifies the name of the OLE DB consumer. This key does not have a default value.

Auto Translate

Specifies whether the OLE DB consumer requests the provider to convert OEM characters or ANSI characters between the code page of the OLE DB consumer and the code page of the database when characters are retrieved from or sent to the database. The valid values are "true" and "false." The default value is "true".

Current Language

Specifies the language that is used for database message selection and formatting. This key does not have a default value.

Network Address

Specifies the network address of an instance of the database server. If the value of the Network Address key is not specified, the default value is the value of the Data Source key. If the value of the Data Source key contains an instance name, the instance name that is contained in the value of the Data Source key will be appended to the value of the Network Address key. For more information about instance names, see [MSDN-UNI].

The network address MUST be in TCP format or NP format.

TCP format

tcp:<host name>\<instance name>

tcp:<host name>,<TCP/IP port number>

TCP format MUST start with the prefix "tcp:" and is followed by the database instance, specified by a <host name> and an <instance name>.

The <host name> MUST be specified in one of three ways: NetBIOSName [RFC1002], IPv4Address [RFC791], or IPv6Address [RFC2460].

The <instance name> is used to resolve to a particular TCP/IP port number [RFC793] on which a database instance is hosted. Alternatively, a <TCP/IP port number> can be specified directly. If both <instance name> and <port number> are not present, the default database instance is used.

NP format

np:\\<host name>\pipe\<pipe name>

NP format MUST start with the prefix "np:" and is followed by a named pipe name.

The <host name> MUST be specified in one of three ways: NetBIOSName [RFC1002], IPv4Address [RFC791], or IPv6Address [RFC2460].

The <pipe name> is used to identify the database instance to which to be connected.

If the value of the Network Library key is specified, the prefixes "tcp:" and"np:" SHOULD NOT be specified.<10>

For more information about the format of the Network Address key, see [MSKB-313295].

For more information about named pipes, see [PIPE].

Network Library

This key is the name of the network component that is used to communicate with the database server*. This key does not have a default value.

Packet Size

Sets the network packet size in bytes (as specified by the PacketSize field in section 2.2.6.3 of [MS-TDS]) to be used for data exchange between the data source object and the database. The valid values are unsigned integers that range from greater than or equal to 512 to less than or equal to 32767. The default packet size is 4096 bytes.

Use Procedure for Prepare

Specifies that the OLE DB consumer requests a temporary stored procedure to be created on the database when a command is prepared. The valid values are the following:

"1": A temporary Stored Procedure is created when a command is prepared. All temporary Stored Procedures are dropped when the session is released.

"2": A temporary stored procedure is created when a command is prepared. The procedure is dropped when the command is unprepared, when a new command is specified, or when all application references to the command are released.

The default value is "1".

Workstation ID

Sets the workstation identifier as specified by the ibHostName and cchHostName fields in section 2.2.6.3 of [MS-TDS]. The default value is the name of the workstation that is running the OLE DB consumer.

Initial File Name

Sets the name of the primary file of an attachable database as specified by the ibAtchDBFile and cchAtchDBFile fields in section 2.2.6.3 of [MS-TDS]. This key does not have a default value. For more information about attachable databases, see [MSDN-DAD]. If a value for this key is specified, a value for the Initial Catalog key MUST also be specified.

Use Encryption for Data

Specifies whether data should be encrypted before sending it over the network. The valid values are "true" and "false". The default value is "false".

Replication server name connect option

Sets the server name (as specified by the ibServerName and cchServerName fields in section 2.2.6.3 of [MS-TDS]) and replication login type (as specified by the fUserType field in section 2.2.6.3 of [MS-TDS]) that the OLE DB consumer requests to send to the database server.

Tag with column collation when possible

Specifies whether the OLE DB consumer requests that data be tagged with collation information that is obtained from the database server instead of from the code page on the provider. The valid values are "true" and "false". The default value is "false".

*There are several of these named components (values),<11> each of which implements a specific protocol behavior.