IIS无法调用OLEDB API [英] IIS failed to call OLEDB APIs

查看:392
本文介绍了IIS无法调用OLEDB API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站使用OLEDB连接到MS SQL分析服务器服务。我使用C ++来调用OLEDB API,并将其构建为DLL,它被加载到IIS并由我的网站调用。如果我在本地运行C ++模块,但是我的网站无法连接到IIS中的数据源,我可以通过调用OLEB API成功连接到数据源。

错误消息是传输层遇到错误。根据 MSDN文档,这是一个身份验证问题。但是在数据源端允许匿名用户。

我很高兴我的网站可以在VS2010内置的Web服务器中正常运行。我注意到的一个事情是VS2010内置的Web服务器和本地C ++模块正在运行与我目前使用的帐户,IIS正在运行与网络服务帐户。所以我根据本文。但是IIS仍然无法连接到数据源。

I have a website which uses OLEDB to connect to MS SQL Analysis Server Services. I use C++ to call OLEDB APIs, and build it as DLL, which is loaded into IIS and called by my website. I can successfully connect to data source by calling OLEB APIs if I run C++ module locally, but my website fails to connect to data source in IIS.
The error message is "An error was encountered in the transport layer". According to MSDN documents, it's an authentication problem. But anonymous user is allowed in data source side.
And it's curious that my website can run normally in VS2010 built-in web server. One thing I noticed is both VS2010 built-in web server and local C++ module are running with my current use account, and IIS is running with Network Service account. So I configured IIS using my current use account according to this article. But IIS still cannot connect to data source.

推荐答案

我已经解决了这个问题。根据此文档,用于处理请求的IIS中的线程标识受许多选项的影响。当impersonate为true并且身份验证模式为Windows时,如果IIS使用匿名身份验证,则线程的身份为MACHINE \IUSR_MACHINE。此帐户不受数据源信任。对IIS使用其他身份验证模式并登录到IIS,并且数据源信任的帐户可以解决此问题

I've solved this problem. The identity of thread in IIS used to handle request is affected by many options according to this document. When impersonate is true and authentication mode is Windows, if IIS uses anonymous authentication, , the identity of thread is MACHINE\IUSR_MACHINE. This account is not trusted by data source. Use other authentication modes for IIS and login into IIS with account is trusted by data source can solve this problem

这篇关于IIS无法调用OLEDB API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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