?
Solved

SQL 2012 Connection Question

Posted on 2013-12-04
1
Medium Priority
?
307 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
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

840 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