Windows上通过本机C ++(无ATL)的SQL Server 2012首选访问方法 [英] SQL Server 2012 via native C++ (no ATL) preferred access method from Windows

查看:89
本文介绍了Windows上通过本机C ++(无ATL)的SQL Server 2012首选访问方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Windows 64下运行的本机C ++应用程序,它不使用ATL(并且不会).我希望能够通过网络从我的应用程序连接到SQL Server 2012.

I have a native C++ application that runs under Windows 64, it doesn't use ATL (and will not). I want to be able to connect from my application to SQL Server 2012 over the network.

我有以下要求:

  • 性能是关键

  • Performance is the key

C ++将仅插入记录(例如,通过调用存储过程),而不会插入其他记录(没有选择,删除或更新).

The C++ will only insert records (say by calling Stored Procs), nothing else (no selects, deletes or updates).

记录插入应为非阻塞(异步).

Record insertions should be non-blocking (async).

我将选择范围缩小到OLE DB和ODBC,因为它们满足上述条件.但是,似乎Internet上有很多关于使用什么的相互矛盾的建议.例子:

I narrowed my choices down to OLE DB and ODBC as they satisfy the criteria above. However, it seems that the Internet have loads of contradicting advice of what to use. Examples:

不建议使用OLE DB"源:

"OLE DB is deprecated" source: http://weblogs.sqlteam.com/dang/archive/2011/09/04/rip-ole-db.aspx

"避免为新的SQL Server应用程序开发使用OLE DB.更新您的技术路线图,以迁移到使用SQLNCLI,SQLNCLI10, SQLNCLI11 或SQLOLEDB OLE DB提供程序的现有SQL Server应用程序的迁移SQL Server Native Client ODBC驱动程序."来源: http://weblogs.sqlteam.com /dang/archive/2011/09/04/rip-ole-db.aspx ,但SQLNCLI11是基于MSDN的SQL Server本机客户端ODBC驱动程序:

"Avoid using OLE DB for new SQL Server application development. Update your technology roadmap to move towards migrating existing SQL Server applications that use the SQLNCLI, SQLNCLI10, SQLNCLI11 or SQLOLEDB OLE DB providers to the SQL Server Native Client ODBC driver." source: http://weblogs.sqlteam.com/dang/archive/2011/09/04/rip-ole-db.aspx but SQLNCLI11 is the SQL Server Native Client ODBC driver based on MSDN: http://msdn.microsoft.com/library/ms130904.aspx so, was it a typo in the blog?

我真的很困惑,并且希望就使用我的标准来访问SQL Server的最佳技术征询更多意见.

推荐答案

OleDB和ODBC都使用SQLNCLI.请参见按版本列出的组件名称和属性表,观察者如何Sqlncli.dll /Sqlncli10.dll/Sqlncli11.dll是ODBC和OleDB的驱动程序.

Both OleDB and ODBC use the SQLNCLI. See the Component Names and Properties by Version table, observer how Sqlncli.dll/Sqlncli10.dll/Sqlncli11.dll is the driver for both ODBC and OleDB.

如果您查看数据访问技术路线图,您将会看到ODBC和OleDB都是最新的并且受支持. 已弃用是SQLOLEDB和SQLODBC,它们是旧的MDAC用于OleDB和ODBC(即sqlsrv32.dll和Sqloledb.dll)的SQL Server驱动器.对于它们两者都有升级路径和建议,请参见将应用程序更新为SQL Server Native来自MDAC的客户端.

If you look at Data Access Technologies Road Map you'll see that both ODBC and OleDB are current and supported. What is deprecated is SQLOLEDB and SQLODBC, which are the old MDAC SQL Server drives for OleDB and ODBC (ie. sqlsrv32.dll and Sqloledb.dll). For both of them there are upgrade paths and recomendations, see Updating an Application to SQL Server Native Client from MDAC.

因此,结论是您可以安全地继续使用ODBC和OleDB,只需确保您使用的是基于SLNCLI的现代驱动程序,而不要使用旧的,不推荐使用的MDAC驱动程序.

So the conclusion is that you can safely continue to use both ODBC and OleDB, just make sure you use the modern SLNCLI based drivers and not the old, deprecated, MDAC drivers.

使用不推荐使用的驱动程序的主要风险是缺乏对新数据类型(例如地理,层次结构,datetime2等)的支持.

The main risk in using deprecated drivers is lack of support for new data types (eg. geography, hierachy, datetime2 etc etc).

这篇关于Windows上通过本机C ++(无ATL)的SQL Server 2012首选访问方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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