1

I have to update a very old site using classic ASP and SQLOLEDB but the connection to SQL Server doesn't work using SQL Server 2014.

It works for my client using SQL Server 2008 R2, but it doesn't work for me using SQL Server 2014.

The obvious answer is to install SQL Server 2008 R2 locally, however the entire setup can take quite some time.

Is there some SQL Server 2014 setting that I am missing?

This is my connection string:

"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=myUser;PASSWORD=123456;Initial Catalog=myCatalog;Data Source=localhost;Network Library=DBMSSOCN"

The error I get is:

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

I can connect to that server using SQL Server Management Studio with that password and user. And that connection string works fine if the Instance is SQL Server 2008 R2. So there must be a difference between 2014 and 2008 R2.

TT.
  • 15,774
  • 6
  • 47
  • 88
Dzyann
  • 5,062
  • 11
  • 63
  • 95
  • 1
    Try removing `Library=DBMSSOCN`. I know you're trying to force the use of TCP; but try it without it. – Ian Boyd Mar 19 '22 at 02:55

1 Answers1

0

I would suggest adding the connection port into your string. Default is 1433 unless you have changed it. The following code will give you the server port information:

SELECT DISTINCT 
local_tcp_port 
FROM sys.dm_exec_connections 
WHERE local_tcp_port IS NOT NULL
bwilliamson
  • 391
  • 1
  • 13
  • Thanks @bwilliamson, I had tried that and it didnt work sadly :( – Dzyann Nov 08 '16 at 22:58
  • I think your connection string might be off according to this site. [LINK] (https://www.connectionstrings.com/sql-server/) Try Provider=SQLNCLI11; – bwilliamson Nov 09 '16 at 14:07