Over the years, Visual C++ has provided several ways to work with databases. Currently, the preferred way to connect to databases in native C++ is to use ODBC directly by calling ODBC APIs, or by using the MFC ODBC wrapper classes, or by using a third-party C++ wrapper library for ODBC. The OLE DB standard, and the ATL OLE DB classes and templates are still supported, but the OLE DB provider for SQL Server has been deprecated since SQL Server 2012. The SQL Native Client component, which packages OLE DB and ODBC drivers in a single DLL, is also deprecated. New C++ applications that connect to SQL Server or Azure SQL Database should use the most recent ODBC driver. Microsoft provides versions of this driver for MacOS and Linux in addition to Windows. By using ODBC you gain maximum portability of your code over multiple platforms and data sources. Most SQL database products and many NoSQL products support ODBC.
0 commit comments