[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SQL 2012 Connection Question

Posted on 2013-12-04
1
Medium Priority
?
306 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

656 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