CLASSIC ASP - SQL Server does not exist or access

2019-07-06 11:00发布

问题:

I'm trying to make a connection to a SQL Server Express DB on localhost, but I get the following error message:

Microsoft OLE DB Provider for SQL Server (0x80004005)

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

The code I'm using is

Dim connection 
Set connection = CreateObject("ADODB.connection") 
connection.connectionString = "server=localhost;Provider=SQLOLEDB;Data Source=RiskManagement;Initial Catalog=RiskManagement;User ID=sa;Password=myPass;" 
connection.Open() 

Any ideas?

回答1:

First thing to always check is that you have configured SQL Server to allow remote connections.

How to configure SQL Server 2005 to allow remote connections

For generic SQL Server Connectivity Troubleshooting consult the following Blog Post



回答2:

I also faced same issue, when I investigated around the network connectvity then I come to know from application server (example Windows 10.10.10.10 or AppServer) is unable to connect database server (Like DBServer or 10.10.10.11). So once check whether it's pinging from the application server, where application is hosted or located.



回答3:

I got this issue because ESET firewall was on. I installed an update of a VB6 program. The new .exe had to be entered into the firewall