简体   繁体   English

使用Windows身份验证从经典ASP连接到SQL Server数据库

[英]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.

相关问题 经典ASP - 使用Windows身份验证的SQL Server 2008连接字符串 - Classic ASP - SQL Server 2008 Connection String using Windows Authentication 经典ASP,使用Windows身份验证登录SQL Server时出现问题 - Classic ASP, problem logging in to SQL Server using Windows Authentication 使用SQL Native Client无法从Classic ASP连接到SQL Server 2008 R2(Windows 7 - IIS7) - Cannot connect from Classic ASP to SQL Server 2008 R2 using SQL Native Client (Windows 7 - IIS7) 使用integratedSecurity(Windows身份验证)通过JDBC从Linux连接到SQL Server? - Connect to SQL Server from Linux via JDBC using integratedSecurity (Windows authentication)? 使用jdbc从java连接到sql server(Windows身份验证模式) - Connect to sql server from java with jdbc(windows authentication mode) 如何使用 Windows 身份验证从命令提示符连接到 SQL 服务器 - How to connect to SQL Server from command prompt with Windows authentication 从经典 asp 连接到 sql 服务器 - connecting to sql server from classic asp 从经典ASP连接到SQL Server - Connection to SQL Server from classic ASP 从Windows身份验证更改为sql服务器身份验证 - change from windows authentication to sql server authentication C#Windows应用程序:使用Windows身份验证连接到远程SQL Server 2008的连接字符串 - C# Windows application: connection string to connect to remote sql server 2008 using windows authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM