经典ASP问题连接到远程SQL Server数据库 [英] Classic ASP problem connecting to remote SQL Server database

查看:441
本文介绍了经典ASP问题连接到远程SQL Server数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个经典的ASP应用程序,我试图连接到不同的服务器上的SQL Server 2008数据库。 ASP应用程序是从Windows Server 2008上的IIS7提供的。

I have a classic ASP app that I am trying to connect to a SQL Server 2008 database on a different server. The ASP app is being served from IIS7 on Windows Server 2008.

我已将网站的应用程序池更改为在特定的Windows帐户下运行, 我已验证可以访问远程服务器上的数据库。

I have changed the web site's application pool to run under a specific windows account, that I have verified has access to the database on the remote server.

但是,当我在浏览器中运行应用程序时,此错误:

However, when I run the app in the browser, I get this error:


Application Error 
Number: -2147217843 (0x80040E4D)
Source: Microsoft OLE DB Provider for SQL Server
Description: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. 

为什么试图使用NT AUTHORITY \ANONYMOUS登录连接?
应用程序池标识不适用于传统ASP代码吗?
如何以特定用户身份进行连接?

Why is it trying to connect using NT AUTHORITY\ANONYMOUS LOGON? Does the App pool identity not apply to classic ASP code? How can I make this connect as a specific user?

string我使用:

Here is the connection string I am using:


Provider = SQLOLEDB.1; Data Source = myDbServer; Initial Catalog = myDatabase; Integrated Security = SSPI

Provider=SQLOLEDB.1;Data Source=myDbServer;Initial Catalog=myDatabase;Integrated Security=SSPI


推荐答案

对于要使用应用程序池标识用于经典ASP的网站,您需要更改所使用的凭据匿名验证。默认情况下,网站将设置为使用特定用户,即IUSR。

For a site to use the application pool identity for classic ASP, you need to change the credentials used for Anonymous Authentication. By default, the site will be set to use a specific user, namely IUSR.

从您网站的IIS区域选择验证选择匿名验证,然后选择编辑。从特定用户更改为应用程序池标识

Select Authentication from the IIS area of your site, then select Anonymous Authentication followed by Edit. Change from Specific user to Application pool identity.

建议使用Windows身份验证(集成安全性)通过SQL身份验证,以便您的配置文件中没有凭据因此,如果这些文件被泄露,您不会失去对凭据的控制。

It's advisable to use Windows authentication (integrated security) over SQL authentication so that you don't have credentials in your config files so that if those files are compromised, you don't lose control of the credentials.

这篇关于经典ASP问题连接到远程SQL Server数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆