Solved

SQL 2012 Connection Question

Posted on 2013-12-04
1
295 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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.
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.

860 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