IIS failed to call OLEDB APIs

2019-07-06 04:13发布

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条回答
叛逆
2楼-- · 2019-07-06 04:54

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

查看更多
登录 后发表回答