0

I have moved a site from a Window Server 2003 server to a Window Server 2008 server (64 bit). The site connects to a SQL Server 2005 database. I imported the database, and I am running it under SQL Server 2014 (64bit).

I have the IIS on the Window Server 2008 server running the site. The site runs in classic ASP. I am attempting to determine what connection object type I need to make the classic ASP website connect to the SQL Server 2014 database.

This is the old DSN:

Provider=sqloledb;Data Source=MYSERVER\SQLEXPRESS;Initial Catalog=theDatabase;User Id=myID;Password=password
11
  • 4
    What exactly is the question? If you moved the database to a new server you just put the name of the new server as the Data Source. You will also need to make sure you migrated or created the login.
    – user507
    Commented Aug 6, 2015 at 4:22
  • Take a look here: connectionstrings.com
    – user_0
    Commented Aug 6, 2015 at 9:14
  • As Shawn mentioned, the only required change is the Data Source. However, note that the legacy SQLOLEDB provider has been deprecated for several years in favor of SQL Server Native client. If you install the latest version (SQL Server Native Client 11.0) on the web server, you can change the provider specification to SQLNCLI11.1 along with the server name change.
    – Dan Guzman
    Commented Aug 6, 2015 at 12:38
  • @ShawnMelton I was not sure what provider to put in my connection string. Commented Aug 6, 2015 at 13:23
  • Have you tried the same one you use on the previous server?
    – user507
    Commented Aug 6, 2015 at 13:38

1 Answer 1

2

If the application is obfuscating the error message, try connecting with a Powershell script. Perhaps this will provide more information about the cause of the connection error. Even if you don't have the Native Client installed, the legacy SQLOLEDB provider that ships with Windows should still work:

$connection = New-Object -ComObject ADODB.Connection;

Write-Output "Connecting using provider SQLOLEDB";
$connection.Open("Provider=SQLOLEDB; Data Source=localhost\SQLEXPRESS; Initial Catalog=Calendar; User Id=userName; Password=password");

Write-Output "Connecting using provider SQLNCLI11.1";
$connection.Open("Provider=SQLNCLI11.1; Data Source=localhost\SQLEXPRESS; Initial Catalog=Calendar; User Id=userName; Password=password");

To use SQL Server Native Client, check to ensure SQL Server 2012 Native Client is listed as an installed program. It can be downloaded and installed from the Feature Pack downloads: https://www.microsoft.com/en-us/download/confirmation.aspx?id=29065.

1
  • The server did not like the sqlncli11 string but it did like the sqloledb string. Also, I had a mistake in the password too. Commented Aug 10, 2015 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.