如何检查是否在客户端安装了浏览时SQLNCLI10供应商? [英] How to check if a client has SQLNCLI10 provider installed when browsing?

查看:169
本文介绍了如何检查是否在客户端安装了浏览时SQLNCLI10供应商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#的网站,它允许客户端直接连接到他们的PC 远程SQL Server数据库,绕过Web服务器,通过使用第三方ActiveX控件。我本来使用的 SQLOLEDB 的供应商,这是工作的罚款。客户是在内部网络(使用Windows计算机和Internet Explorer)和网站不能用于接触到的一般网络连接。

I have a c# website that allows a client to connect directly to a remote SQL Server database from their PC, bypassing the web server, by using a 3rd party ActiveX control. I was originally using the SQLOLEDB provider and it was working fine. The clients are in an internal network (using Windows machines and Internet Explorer) and the website is not intended for exposure to the general internet.

我不得不使用升级的 SQLOLEDB 的提供者在 SQLNCLI10 的供应商,以满足SQL Server中的新数据类型2008年它的工作在我的电脑上,却爆出生产。我没有意识到的是,它的工作,因为 SQLOLEDB 的提供者是Windows操作系统(MDAC / WDAC)的一部分,因此已经存在于客户端的PC机上。在 SQLNCLI10 的提供者是作为SQL Server 2008中的一部分,必须要在客户机上分别安装(因为他们大多安装了SQL Server不会有,但我这样做)。

I had to upgrade from using the SQLOLEDB provider to the SQLNCLI10 provider to cater for the new datatypes in SQL Server 2008. It worked on my PC, but broke in production. What I didn't realise is that it worked because the SQLOLEDB provider is part of the Windows OS (MDAC/WDAC) so already exists on the client's PC. The SQLNCLI10 provider is included as part of SQL Server 2008 and has to be installed separately on the client machine (because most of them won't have SQL Server installed, but I do).

我可以提供一个链接,为他们下载<一个href=\"http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en\"相对=nofollow>独立的Microsoft SQL Server 2008 Native Client提供从,但我怎么检查他们是否已经安装?

I can provide a link for them to download a standalone Microsoft SQL Server 2008 Native Client provider from, but how do I check if they already have it installed?

推荐答案

无奈的是,微软似乎并没有就如何测试客户端库是否present一个明确的答案。网络搜索和注册嗅探至少揭示了以下注册表键值:

Frustratingly, Microsoft does not seem to give an unambiguous answer on how to test whether the client library is present. Web searching and registry sniffing reveals at least the follow registry keys:

HLKM\SOFTWARE\Microsoft\SQLNCLI11 (key:InstalledVersion)
HLKM\SOFTWARE\Microsoft\SQLNCLI10 (key:InstalledVersion)
HKLM\SOFTWARE\Microsoft\Microsoft SQL Native Client\CurrentVersion (version 9, i presume?)
HLKM\SOFTWARE\Microsoft\Microsoft SQL Server Native Client 10.0\CurrentVersion (key:Version)
HLKM\SOFTWARE\Microsoft\Microsoft SQL Server Native Client 11.0\CurrentVersion (key:Version)

<一个href=\"http://blogs.msdn.com/b/sqlex$p$pss/archive/2006/07/29/faq-detecting-sql-server-2005-using-wmi.aspx\"相对=nofollow>本博客文章在MSDN 表明,使用注册表项来回答一个相关的问题(在SQL Server防爆preSS安装)是错,错,错了,你应该写200行的WMI code来代替。在<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/sqlgetstarted/thread/a182caa6-2fd7-498c-afb7-47c49fcd6c11\"相对=nofollow> WMI方法似乎同样的无证,甚至更脆弱了我。

This blog post at MSDN suggests that using registry keys to answer a related question (is SQL Server Express installed) is wrong, wrong, wrong and you should write 200 lines of WMI code instead. The WMI approaches seem equally undocumented and even more fragile to me.

由于微软允许SQL Native Client的包被重新分配,也许是最好的选择是简单地包括MSI在应用程序的安装程序并运行它,它是否需要与否。请参见他们提供中的各种驱动程序支持的操作系统的该名单显示有也有10.5版(!)。

Since Microsoft allows the SQL Native Client package to be redistributed, perhaps the best choice is simply include the msi in your application's installer and run it whether it is needed or not. See this list of supported operating system for the various drivers they provide which reveals there is also a version 10.5(!).

SQLNCLI安装在平行于基于MDAC的驱动程序,所以它应该是安全的运行 MSIEXEC 在此,让它走的细节。

SQLNCLI is installed in parallel to MDAC-based drivers, so it should be safe to run msiexec on this and let it take care of the details.

这篇关于如何检查是否在客户端安装了浏览时SQLNCLI10供应商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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