Cannot connect from Classic ASP to SQL Server 2008 R2 using SQL Native Client (Windows 7 - IIS7)

泄露秘密 提交于 2019-12-04 01:40:48

Try changing the provider to sqlncli10:

cn.Open "Provider=SQLNCLI10;Server=remoteServer\SQL2008R2;Database=DB;UID=MyUser;PWD=pa55word;"

Maybe the name is differet on your machine. :)

For users having only Visual Studio 2012 installed can use Provider=SQLNCLI11 as SQLNCLI10 is not available for me on my fresh installed system.

cn.Open "Provider=SQLNCLI11;Server=remoteServer\SQL2008R2;Database=DB;UID=MyUser;PWD=pa55word;"

It could be related to the VPN fact. Maybe the app acts as a different user who doesn't have access to the VPN.

Try to turn off anonymous Authentication in IIS and/or make the Application Pool identity be the same user you use to login to the Windows 7 machine and see if this fixes the problem.

Arvind Kumar

Works perfectly fine:

"Provider=SQLNCLI;Server=xxxxxxxx;uid=sa;pwd=xxxxxx;database=xxxxxx;"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!