Solved

SQL 2012 Connection Question

Posted on 2013-12-04
1
285 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 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now