Using ADO with SQL Server Native Client

To enable the usage of SQL Server Native Client, ADO applications will need to implement the following keywords in their connection strings:

Provider=SQLNCLI10
DataTypeCompatibility=80

The following is an example of establishing an ADO connection string that is fully enabled to work with SQL Server Native Client (SQL Server 2008 R2):

Dim connection As New ADODB.Connection
connection.ConnectionString = “Provider=SQLNCLI10;” _
& “SERVER=(local);” _
& “Database=Northwind;” _
& “DataTypeCompatibility=80;” _
& “User Id=sa;” _
& “Password=Pa$$w0rd;”
connection.Open

The following is an example of establishing an ADO connection string that is fully enabled to work with SQL Server Native Client (SQL Server 2012 and SQL Server 2014):

Dim connection As New ADODB.Connection
connection.ConnectionString = “Provider=SQLNCLI11;” _
& “SERVER=(local);” _
& “Database=Northwind;” _
& “DataTypeCompatibility=80;” _
& “User Id=sa;” _
& “Password=Pa$$w0rd;”
connection.Open

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: