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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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