ConnectionString问题-Windows 2008上的SQL Server 2008 [英] ConnectionString issues - SQL Server 2008 on Windows 2008

查看:173
本文介绍了ConnectionString问题-Windows 2008上的SQL Server 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个第三方程序,该程序曾经在Windows 2003上针对SQL Server 2000数据库运行(应用程序和数据库位于同一台计算机上)。我们正在尝试在Windows 2008 / SQL Server 2008上迁移/安装它。

We have a third party program that used to run on Windows 2003 against SQL Server 2000 database (app and db are on same machine). We are trying to migrate/install it on Windows 2008/ SQL Server 2008.

指定的连接字符串似乎不允许它将其连接到SQL Server(请参见

The connection string as specified does not seem to allow it to connect it to SQL Server (see below)

    <Configuration name="PROG">
    <ADOConnection>
        Provider=SQLOLEDB.1;Persist Security Info=False;User Id=sa;Pwd=p@ssw0rd;Initial Catalog=DB_NEW;Data source=servername
    </ADOConnection>
</Configuration>

我尝试了另一种方法,但这也不起作用

I tried an alternate one and that also does not work

<Configuration name="PROG">
     <ADOConnection>    
Provider=SQLNCLI10.1;Persist Security Info=False;Initial Catalog=DB_NEW;Data Source=servername;Uid=sa; Pwd=p@ssw0rd;


我当时能够使用下面的方法成功地将应用程序连接到Windows 2003上的SQL Server 2008数据库

I was able to use the one below to successfully connect the application to a SQL Server 2008 database on Windows 2003

<Configuration name="PROG">
    <ADOConnection>
        Provider=SQLOLEDB.1;Persist Security Info=False;User Id=sa;Pwd=p@ssw0rd;Initial Catalog=DB_NEW;Data source=servername
    </ADOConnection>

是否可以将应用程序连接到Windows 2008 Server上的SQL Server 2008?

What is the right syntax to get the application to connect to a SQL Server 2008 on Windows 2008 server?

推荐答案

您可以检查哪个提供程序版本是通过在注册表中查看安装:
HKEY_CLASSES_ROOT\SQLNCLI10\Clsid

You can check which provider version(s) are installed by looking in the registry: HKEY_CLASSES_ROOT\SQLNCLI10\Clsid

HKEY_CLASSES_ROOT\SQLNCLI10.1\Clsid(用于10.1版等)

HKEY_CLASSES_ROOT\SQLNCLI10.1\Clsid (for version 10.1 etc)

SQLNCLI10(SQL Server本机客户端)名称是计算机上安装的最新版本的别名。在您的2003框中,您还会在注册表中找到sqloledb的条目,而您可能没有在2008框中安装这些条目。

The SQLNCLI10 (sql server native client) name is an alias to the latest version installed on the computer. On your 2003 box you will also find entries for sqloledb in the registry which you likely won't have installed on the 2008 box.

我希望以下内容可以正常工作:
Provider = SQLNCLI10;持久安全信息= False;用户ID = sa; Pwd = p @ ssw0rd;初始目录= DB_NEW;数据源=服务器名

I would expect that the following should work: Provider=SQLNCLI10;Persist Security Info=False;User Id=sa;Pwd=p@ssw0rd;Initial Catalog=DB_NEW;Data source=servername

有关连接字符串和各种提供程序的格式的更多信息,请参见:此连接字符串站点

For more info on the formatting of the connection string and the various provider see: this connectionstring site

这篇关于ConnectionString问题-Windows 2008上的SQL Server 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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