?
Solved

SQL 2012 Connection Question

Posted on 2013-12-04
1
Medium Priority
?
299 Views
Last Modified: 2014-01-28
I am attempting to use the following:

set cnn = createobject("ADODB.Connection")
cnn.ConnectionString = "Provider=SQLNCLI11;" _
         & "Data Source=DSName;" _
         & "Database=DBName;" _ 
         & "Integrated Security=SSPI;" _
         & "DataTypeCompatibility=80;" _
         & "MARS Connection=True;"
cnn.open

Open in new window

but get the error:
Microsoft SQL Server Native Client 11.0: Named Pipes Provider: Could not open a connection to SQL Server [53]


When I use Driver={SQL Server Native Client 11.0}; instead of Provider=SQLNCLI11;, it seems to work except for nvarchar(max) fields.  And base on documentation on http://msdn.microsoft.com/en-us/library/ms130978.aspx it is recommended to use the Provider=SQLNCLI11.

I see it installed in my ODBC driver set, but keep getting the error.

What am I doing wrong?!?!
0
Comment
Question by:michd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
UnifiedIS earned 2000 total points
ID: 39696372
connectionstrings.com shows this as the syntax for a trusted connection to sql 2012

Provider=SQLNCLI11;Server=myServerAddress;Database=myDataBase;
Trusted_Connection=yes;

also notes that trusted_connected=yes and integrated security=sspi are interchangeable

From looking at yours, try switching out "data source" for "server".

It also says you should not use this type for .net apps, instead use the ".NET Framework Data Provider for SQL Server" so you may just want to set up your connection string like this one:
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
MultipleActiveResultSets=true;
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question