SQL Server 2005 Connection Error

Discussion in 'Classic ASP' started by paul41, May 27, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a application written in classic ASP that I am having problems getting to connect to a SQL Server 2005 server. This application has been running for years on SQL Sever 2000, but the server the database is on is being taken down and replaced with on on 2005. The following is what I am using to connect (which works fine on the old 2000 server).

    Code:
    set objConn = Server.CreateObject("adodb.connection") 	 		
    ds = "MYSERVER
    pwd = "PASSWORD"
    user = "USER"
    db = "DATABASE"
    connstr = "Provider=SQLOLEDB.1;Password=" & pwd & ";Persist Security Info=True;User ID=" & user & ";Initial Catalog=" & db & ";Data Source=" & ds
    objConn.Open connstr
    When I use this I get the following error.

    Using the same user name and password I am able to log into the new server with Query Analyzer so I know that isn't the problem. I am also able to create a ODBC connection with this user and password. Any ideas?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    The problem has to do w/ the connection string.

    I would dump out the connection string. You most likely missed the server name.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page