通过Classic ASP连接到SQL服务器(Windows身份验证)

时间:2021-12-22 01:40:11

hey, I wanna connect to sql with windows Authentication either sql server authentication but frankly i can't :

嘿,我想连接到Windows与Windows身份验证sql服务器身份验证,但坦率地说,我不能:

this is my connection string :

这是我的连接字符串:

<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
'conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = Northwind; User Id=Mohammad-PC/Mohammad; Password="
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = Northwind; User Id=sa; Password="
If conn.errors.count = 0 Then
Response.Write "Connected OK"
End If
%>

and i get this error :

我得到这个错误:

Microsoft OLE DB Provider for SQL Server: Login timeout expired

i've set session timeout to 10mins but still same. i use IIS 7.5 and sql server 2005

我已将会话超时设置为10分钟,但仍然相同。我使用IIS 7.5和SQL Server 2005

2 个解决方案

#1


1  

The msdn-support gives a couple of hints, mostly about the firewall configuration and the port the database engine listens to which might not be the standard 1433 due to security issues.
Try adding the port number to the Data Source, sth like:

msdn-support提供了一些提示,主要是关于防火墙配置和数据库引擎侦听的端口,由于安全问题,它可能不是标准的1433。尝试将端口号添加到数据源,如:

Provider=SQLOLEDB; Data Source = (local),[port]; Initial Catalog = Northwind; User Id=sa; Password=[password]"



Have a look here:
Solving 'Login timeout expired' Problem

看看这里:解决'登录超时已过期'问题

#2


0  

(local)

is probably not getting resolved. Try localhost or even 127.0.0.1

可能没有得到解决。尝试使用localhost甚至127.0.0.1

#1


1  

The msdn-support gives a couple of hints, mostly about the firewall configuration and the port the database engine listens to which might not be the standard 1433 due to security issues.
Try adding the port number to the Data Source, sth like:

msdn-support提供了一些提示,主要是关于防火墙配置和数据库引擎侦听的端口,由于安全问题,它可能不是标准的1433。尝试将端口号添加到数据源,如:

Provider=SQLOLEDB; Data Source = (local),[port]; Initial Catalog = Northwind; User Id=sa; Password=[password]"



Have a look here:
Solving 'Login timeout expired' Problem

看看这里:解决'登录超时已过期'问题

#2


0  

(local)

is probably not getting resolved. Try localhost or even 127.0.0.1

可能没有得到解决。尝试使用localhost甚至127.0.0.1