CLASSIC ASP - SQL Server does not exist or access denied

爷,独闯天下 提交于 2019-12-23 19:12:09

问题


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



来源:https://stackoverflow.com/questions/1410021/classic-asp-sql-server-does-not-exist-or-access-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!