0

We have an application written in C (not c++) that uses sqlncli.h, specifically, the ODBC implementation and not OLEDB. According to Microsoft

The SQL Server Native Client (SQLNCLI) remains deprecated and it is not recommended to use it for new development work. Instead, use the new Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) which will be updated with the most recent server features.

This quote links to the MSOLEDBSQL article which explains how to build applications with MSOLEDBSQL indicating you should:

  1. To use the new Microsoft OLE DB Driver for SQL Server in existing applications, you should plan to convert your connection strings from SQLOLEDB or SQLNCLI, to MSOLEDBSQL.

and

  1. Use the new headers (article it links to is here)

It's that simple, right? Not really, because we've tried to follow these instructions and implement the new header (msoledbsql.h) and it doesn't seem to support older data types such as DBINT which are from sqlncli.h. So, I'm thinking at this point the deprecation announcement may not pertain to ODBC. And the comment

As such, backwards compatibility with applications currently using SNAC 11 is maintained in this new release

found here only pertains to OLEDB

My question is that if you are using SQLNCLI ODBC (and not SQLNCLI OLEDB), it seems that is not actually deprecated. Is that correct? As an example, the deprecation warning exists for OLEDB here, but not for the ODBC page here.

Thanks in advance for the help.

DbForumGuy
  • 63
  • 1
  • 6

1 Answers1

1

if you are using SQLNCLI ODBC (and not SQLNCLI OLEDB), it seems that is not actually deprecated

It is deprecated, but still supported some versions. When the SQL Server OleDB Provider in SQLNCLI was deprecated, the packaging of the ODBC driver changed, and the code ported to the ODBC Driver For SQL Server.

The OleDb provider was later un-deprecated and a new one was produced. But that's another story.

So essentially with SNAC ODBC you're just on an older version of the ODBC driver, and you should upgrade to a newer version at some point.

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
  • Hi David. Thanks for your fast response. Just for clarification then, is it a true statement to say that a Windows C solution using SNAC ODBC would simply retarget the solution to a newer Windows SDK as that is where the headers for ODBC are delivered, then switch the connection string to utilize the newer driver. Whereas the SNAC OLEDB would follow the article mentioned previously to implement the msoledbsql.h header instead? Thanks a million. I realize there is a Linux SQL driver, but that is a different set of questions for the moment. – DbForumGuy Aug 20 '20 at 00:43
  • 1
    Basically yes. Changing the ODBC driver is a small change. Switching to OleDb a big one. – David Browne - Microsoft Aug 20 '20 at 00:47