我怎么知道我的32位应用程序正在尝试使用sql 2005或sql 2008驱动程序连接到sql服务器(sql native client) [英] How will i know that my 32 bit application is tryting to connect to sql server using sql 2005 or sql 2008 drivers (sql native client)

查看:66
本文介绍了我怎么知道我的32位应用程序正在尝试使用sql 2005或sql 2008驱动程序连接到sql服务器(sql native client)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我怎么知道-我的32位应用程序(c ++)是使用SQL本机客户端2005驱动程序还是SQL本机客户端2008驱动程序连接到SQL Server?


在连接字符串中,已经提到< b> Provider = SQLNCLI10.1;</b>. ,据我了解,它使用的是sql nativeclient2008.

我有一个问题,当未安装sql native client 2005时,我的应用程序崩溃.因为它尝试加载sqlncli.dll,如果不存在则崩溃.
在SQL Client 2005上运行良好.我的应用程序需要升级到SQL Server 2008,因此出现了问题.


我怎么知道-我的32位应用程序(c ++)是使用SQL本机客户端2005驱动程序还是SQL本机客户端2008驱动程序连接到SQL Server?

Hi,

How will i come to know - that wether my 32 bit application(c++) is using SQL native client 2005 drivers or SQL native client 2008 drivers to connect to SQL server?


In the connection string it has been mentioned that <b>Provider=SQLNCLI10.1;</b> , by which i understand sql nativeclient 2008 is used.

I have problem that, my application crashes when sql native client 2005 is not installed. Because it tries to load sqlncli.dll and crashes if its not there.
Works well with SQL client 2005. My application need to upgrade to SQL serve 2008, hence the problem.


How will i know - that wether my 32 bit application(c++) is using SQL native client 2005 drivers or SQL native client 2008 drivers to connect to SQL server?

Any thoghts on this would be of great help.

推荐答案

您可能能够捕获导致崩溃的系统异常.

但是,如果您编写的代码实际查找了所需的dll,可能会更好.您可以只是进行文件搜索,或者可能更好地尝试自己加载dll(如果找到它也将其卸载.)仅在应用程序启动时才需要执行此操作.
You might able to catch the system exception which is causing the crash.

However it might just be better if you wrote code that actually looked for the required dll(s). You can either just do a file search, or probably better try to load the dll yourself (unload it also if you find it.) You need only do that when the application starts.


这篇关于我怎么知道我的32位应用程序正在尝试使用sql 2005或sql 2008驱动程序连接到sql服务器(sql native client)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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