Connection Object

ADO and SQL Server

ADO and SQL Server

Connection Object

A Connection object represents a unique session with a data source. In the case of a client/server database system, it may be equivalent to an actual network connection to the server.

In addition to the standard ADO properties, these dynamic properties are added to the Properties collection of the Connection object.

Dynamic Properties
Active Sessions Property NULL Collation Order Property
Asynchable Abort Property NULL Concatenation Behavior Property
Asynchable Commit Property OLE DB Version Property
Autocommit Isolation Levels Property OLE Object Support Property
Catalog Location Property Open Rowset Support Property
Catalog Term Property ORDER BY Columns in Select List Property
Column Definition Property Output Parameter Availability Property
Connect Timeout Property Pass By Ref Accessors Property
Current Catalog Property Password Property
Data Source Property Persist Security Info Property
Data Source Name Property Persistent ID Type Property
Data Source Object Threading Model Property Prepare Abort Behavior Property
DBMS Name Property Prepare Commit Behavior Property
DBMS Version Property Procedure Term Property
Extended Properties Property Prompt Property
GROUP BY Support Property Provider Friendly Name Property
Heterogeneous Table Support Property Provider Name Property
Identifier Case Sensitivity Property Provider Version Property
Initial Catalog Property Read-Only Data Source Property
Isolation Levels Property Rowset Conversions on Command Property
Isolation Retention Property Schema Term Property
Locale Identifier Property Schema Usage Property
Maximum Index Size Property SQL Support Property
Maximum Row Size Property Structured Storage Property
Maximum Row Size Includes BLOB Property Subquery Support Property
Maximum Tables in SELECT Property Table Term Property
Multiple Parameter Sets Property Transaction DDL Property
Multiple Results Property User ID Property
Multiple Storage Objects Property User Name Property
Multi-Table Update Property Window Handle Property
Provider-Specific Connection Parameters

The Microsoft OLE DB Provider for SQL Server (SQLOLEDB), supports several provider-specific connection parameters in addition to those defined by ADO. As with the ADO connection properties, these provider-specific properties can be set using the ConnectionString property of the Connection object.

Parameter Description
Trusted_Connection Indicates the user authentication mode. This can be set to Yes or No. The default value is No. If this property is set to Yes, SQLOLEDB uses Microsoft Windows Authentication (recommended) to authorize user access to the Microsoft® SQL Server™ database specified by the Location and Datasource property values. If this property is set to No, SQLOLEDB uses Mixed Mode to authorize user access to the SQL Server database. The SQL Server login and password are specified in the User ID and Password properties.
Current Language Indicates a SQL Server language name. Identifies the language used for system message selection and formatting. The language must be installed on the computer running SQL Server; otherwise, opening the connection will fail.
Network Address Indicates the network address of the instance of SQL Server specified by the Location property.
Network Library Indicates the name of the network library (DLL) used to communicate with the SQL Server. The name should not include the path or the .dll file name extension. The default is provided by the SQL Server client configuration.
Use Procedure for Prepare Determines whether SQL Server creates temporary stored procedures when commands are prepared using the Prepared property.
Auto Translate Indicates whether OEM/ANSI characters are converted. This property can be set to True or False. The default value is True. If this property is set to True, SQLOLEDB performs OEM/ANSI character conversion when multibyte character strings are retrieved from, or sent to, SQL Server. If this property is set to False, SQLOLEDB does not perform OEM/ANSI character conversion on multibyte character string data.
Packet Size Indicates a network packet size in bytes. The packet size property value must be from 512 through 32767. The default SQLOLEDB network packet size is 4096.
Application Name Indicates the client application name.
Workstation ID A string identifying the workstation.

See Also

Connecting to a SQL Server Data Source

Using the Connection Object