I migrated the classic ASP site to a new server and received the following error message.
I tried different connection strings, but none of them work.
I'm not even sure if the connection string is a problem
The new server is a Windows 2012 Server machine, SQL Server 2008 R2 Express.
Microsoft OLE DB Provider for SQL Server error '80004005' [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. /scripts/dbcode.asp, line 31
Application("C2M_ConnectionString") = "Provider=SQLNCLI10;Server=(local);Database=mysite_live;Uid=mysitec_Live;Pwd=mypass;"
If it is an Express instance, it is most likely not a default instance, but rather a named instance. Therefore, you probably meant:
... "Provider=SQLNCLI10;Server=.\SQLEXPRESS; ... --- instead of just (local) ---^^^^^^^^^^^^
Otherwise, you will need to show us the server properties in the SQL Server configuration manager on this computer so that we can tell you how to fix the connection string.
, ( Sql , TCP/Ip). SSMS, , . , Sql?
, SQL Server. Sql , , "SQLNCLI" "SQLNCLI10"
ping- . , , . , "localhost". , . , SQL.
= localhost; = DBNAME; Persist Security Info = True; User ID = MyUserName; Password = MyPassword;
. , , SQL. / .
:
EDIT: , SO-, , .
, - , !
!
31:
cmd.ActiveConnection = Application("C2M_ConnectionString")
cmd?
cmd
, ConnectionString , , cmd - .
, IIS 7 IIS 8. ASP IIS 7 , " ". , ?
Option Strict On, - , . (, , .)
- SQL Server OLE DB:
"Provider=sqloledb;Data Source=(local);Initial Catalog=mysite_live;User Id=mysitec_Live;Password=mypass;"
ODBC:
"Driver={SQL Server};Server=SERVERNAME;Trusted_Connection=no;Database=mysite_live;Uid=mysitec_Live;Pwd=mypass;"
, , , . , .
x86/x64?
, , , () - 32- , 64- : http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/c701d510-90e5-4dd0-b14f-ca1d694d6615 ( , , )
.udl , x86, x64?
(http://blogs.msdn.com/b/farukcelik/archive/2007/12/31/udl-test-on-a-64-bit-machine.aspx), local udl:
, , : http://msdn.microsoft.com/en-us/library/ms190445(v=sql.105).aspx
IP- "(local)"? - " Server = 192.168.1.1;" (, IP- )
IP- , "SQL-Server configurator", SQL Server IP-, . ( SQL Server)
, /:
SQL Server . . . " SQL Server" , .
, TCP/IP ( ), 127.0.01, < port number > .
Step-1: enable TCP / IP protocol Start → All programs → Microsoft SQL Server → Configuration Tools → SQL Server Configuration Manager → SQL Server Network Configuration → Protocols for MSSQLSERVER → right-click “TCP / IP” and select “Enable”.
Step-2: change the name of a specific machine in the attributes of the data source. A value (local) will resolve the ni SQL SERVER 2012 problem.