I am writing a C++ application that needs to execute SQL queries in a SQL Server DB and I want to do it using SQL Server Native Client.
The MSDN documentation has no a full reference on it and has a few examples so I am looking for some site having more information on how to connect, execute queries and retrieve results using this API.
Do you guys know where can I more info on it?
Thanks in advance,
Ernesto
SQL Server Native Client can be used to create new applications or enhance existing applications that need to take advantage of features introduced in SQL Server 2005 (9. x), such as multiple active result sets (MARS), user-defined data types (UDT), query notifications, snapshot isolation, and XML data type support.
About - SQL Server Native Client | Microsoft Learn. This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
SQL Server Native Client is the network library that client computers use to connect to SQL Server, starting with Microsoft SQL Server. The settings configured in SQL Server Native Client Configuration, are used on the computer running the client program.
In addition to ODBC as Brian mentions, you can also use OLE DB and/or ADO (which actually makes OLE DB "easy" to use). The three options are briefly introduced in this blog entry
.
Of the ODBC, OLE DB and ADO options, I think the simplest route would be to use ADO. Using ODBC or OLE DB directly is, in my opinion, a somewhat painful process. It can certainly result in very fast code, but you pay for it in development time. This page
has some simple examples.
Edit Since this post was made (both question and answers), OLE DB has been deprecated by Microsoft. So going forward, it probably makes sense to use a solution that does not go through OLE DB. This blog post talks about it some.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With