简体   繁体   中英

ODBC, ADO or OLE DB

What library for connecting C++ with SQL Server do you recommend.

I was searching and found this where is a disccussion about which is best ODBC, ADO or OLE DB ?

In your opinion if I have Windows XP SP 2, SQL Server 2008, and VIsual Studio 2008, what works simple and right?.

Does anyone have a functional example, to test....

For SQL Server you probably want to use ADO.NET . There are a lot of goodies in the SqlClient namespace that you just don't get with any other data access technology. It is also very easy to connect to SQL Server datasources, handle errors etc.

The SqlClient namespace is SQL Server-specific though so if you have thoughts of making your app db-agnostic then you need to look at other options such as the Data.Common namespace which contains a nice factory model that allows you to write "provider independent" db access code.

They all work.

I'd default to the native client (system.data.sqlclient), since it's made specifically for SQL-Server, and probably has the most up-to-date / optimized / complete interface.

Here's some info from MSDN if it helps: http://msdn.microsoft.com/en-us/library/ms810810.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM