本文介绍了从经典ASP使用SQL本机客户端无法连接到SQL Server 2008 R2(Windows 7中 - IIS7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够连接到SQL Server 2008 R2,当我使用提供程序= SQLOLEDB 在我的连接字符串。但是当我使用提供程序= SQLNCLI 在连接字符串,我无法连接。

I'm able to connect to SQL server 2008 R2 when I use Provider=SQLOLEDB in my connection string. But when I use Provider=SQLNCLI in connection string I'm unable to connect.

ADODB.Connection错误'800a0e7a

提供商无法找到。它可能不
  正确安装。

Provider cannot be found. It may not be properly installed.

/test.asp,第7行

/test.asp, line 7

code低于

<%
    Set cn = Server.CreateObject("ADODB.Connection")

    'Doesn't work
    cn.Open "Provider=SQLNCLI;Server=remoteServer\SQL2008R2;Database=DB;UID=MyUser;PWD=pa55word;"

    'Works Perfectly
    'cn.Open "Provider=SQLOLEDB;Server=remoteServer\SQL2008R2;Database=DB;UID=MyUser;PWD=pa55word;"

    cn.CommandTimeout = 900
    cn.Close
    Response.write("dfjslkfsl")
%>

我想(我在Windows 7 IIS 7中,从传统的ASP页)连接的SQL Server是在不同的网络,我使用VPN连接到位于不同的服务器上。

The SQL Server I'm trying to connect (from classic ASP Page within my IIS 7 on windows 7) is located on different server in a different network to which I'm connecting using VPN.

我通过从ODBC数据源管理员SQL本地客户端系统DSN连接到上述的SQL Server 2008 R2(这是通过VPN连接)测试SQL本机客户端。它得到了成功连接。

I tested sql native client by creating a sql native client System DSN connection to the said Sql server 2008 R2 (which is connected through VPN) from ODBC datasource administrator. And it got connected successfully.

这些捕捉是从我的Windows 7系统

These snaps are from my windows 7 system


  • Windows 7中

  • IIS 7

  • 经典的ASP页面(.asp的)

推荐答案

试着改变提供商 SQLNCLI10

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

也许名字differet您的机器上。 :)

Maybe the name is differet on your machine. :)

这篇关于从经典ASP使用SQL本机客户端无法连接到SQL Server 2008 R2(Windows 7中 - IIS7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-05 09:38