[英]Connect to SQL Server database from classic ASP using windows authentication
I am normally a .NET developer so have no experience with classic ASP. 我通常是.NET开发人员,所以没有使用经典ASP的经验。
I have been asked by a client to have a look at their classic ASP site. 一位客户要求我查看他们的经典ASP网站。 I am trying to recreate their site on my local machine so can have a play with but am having difficulty connecting to my copy of the database. 我正在尝试在我的本地计算机上重新创建他们的站点,因此可以玩,但是很难连接到我的数据库副本。 The database has been recreated on SQL Server 2008 using windows authentication and I'm having difficulty with the connection string. 已使用Windows身份验证在SQL Server 2008上重新创建了数据库,但连接字符串存在问题。
This is what I have so far: 这是我到目前为止的内容:
Provider=SQLOLEDB;Data Source=MY-PC\SQLExpress;Initial Catalog=testdb;Integrated Security=SSPI;Persist Security Info=False;
Keeps saying 一直在说
login failed. 登录失败。
Any ideas? 有任何想法吗?
Modify the anonymous user account details that your local site uses to your own logon account. 将您的本地站点使用的匿名用户帐户详细信息修改为您自己的登录帐户。
The problem is that ASP scripts always run using impersonation either of the user associated with an authenticated connection or as the anonymous user account. 问题在于,ASP脚本始终使用与身份验证连接关联的用户或匿名用户帐户的模拟来运行。 The anonymous user is normally the rescricted IUSR account. 匿名用户通常是已注册的IUSR帐户。
You could just turn off anonymous access and turn on Windows Integrated but I find its best for local development purposes to just change the anonymous user. 您可以关闭匿名访问并打开Windows Integrated,但是我发现最好是出于本地开发目的而更改匿名用户。
您需要在SQL Server中为运行应用程序的应用程序池的标识创建一个登录名/用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.