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

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

问题描述

我有我试图连接到SQL Server 2008数据库不同的服务器上的传统的ASP应用程序。 ASP的应用正在从供应IIS7 Windows Server 2008上。

我已经改变了网站的应用程序池下特定的Windows帐户运行,即我已经验证访问该数据库的远程服务器上。

然而,当我运行在浏览器中的应用程序,我得到这个错误:


应用程序错误
数量:-2147217843(0x80040E4D)
来源:Microsoft OLE DB提供程序SQL Server
说明:登录失败,用户NT AUTHORITY \\ ANONYMOUS登录。

为什么尝试使用NT AUTHORITY \\ ANONYMOUS登录连接?
该应用是否池标识并不适用于传统的ASP code?
我怎样才能使这个连接为一个特定的用户?

修改

下面是我使用的连接字符串:


  

提供商= SQLOLEDB.1;数据源= myDbServer;初始目录= MyDatabase的;集成安全性= SSPI



解决方案

有关网站使用的应用程序池标识为传统的ASP,您需要更改用于匿名身份验证凭据。默认情况下,该网站将被设置为使用特定的用户,即IUSR。

选择验证从您的网站的IIS区域,然后选择匿名身份验证之后的修改。从具体的用户更改为应用程序池标识

这是最好了SQL身份验证使用Windows身份验证(集成安全性),使您不必在你的配置文件的凭证,所以,如果这些文件被泄露,你不会失去凭据的控制权。

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.

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'. 

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?

EDIT

Here is the connection string I am using:

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

解决方案

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.

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

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天全站免登陆