<p>What options exist for accessing different databases from C++?
Put differently, what alternatives are there to ADO?
What are the pros and cons?</p>

[{'answer_id': 50168, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': True, 'text': '<ol>\n<li><a href="http://msdn.microsoft.com/en-us/library/ms710252.aspx" rel="nofollow noreferrer">Microsoft ODBC</a>.</li>\n<li>The MFC ODBC classes such as <a href="http://msdn.microsoft.com/en-us/library/2dhc1abk.aspx" rel="nofollow noreferrer">CDatabase</a>.</li>\n<li><a href="http://msdn.microsoft.com/en-us/library/ms722784.aspx" rel="nofollow noreferrer">OleDB</a> (via COM).</li>\n<li>And you can always go through the per-RDBMS native libraries (for example, the <a href="http://msdn.microsoft.com/en-us/library/ms722784.aspx" rel="nofollow noreferrer">SQL Server native library</a>)</li>\n<li><a href="http://msdn.microsoft.com/en-us/library/aa163992.aspx" rel="nofollow noreferrer">DAO</a> (don\'t).</li>\n<li>3rd party ORM providers.</li>\n</ol>\n\n<p>I would recommend going through ODBC or OleDB by default. Native libraries really restrict you, DAO is no fun, there aren\'t a lot of great 3rd-party ORM for C++/Windows.</p>\n'}, {'answer_id': 50438, 'author': 'Mark Krenitsky', 'author_id': 1121861, 'author_profile': 'https://Stackoverflow.com/users/1121861', 'pm_score': 0, 'selected': False, 'text': "<p>One thing - if speed is important and your code doesn't need to be portable, then it may be worth it to use the native libraries. </p>\n\n<p>I don't know much about SQL Server, but I do know that the Oracle OCI calls are faster than using ODBC. But, they tie you to Oracle's version of SQL. It would make sense for SQL Server to be the same way. </p>\n"}, {'answer_id': 67220, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>There is the <a href="http://pocoproject.org/poco/wiki/tiki-index.php?page=DataUserManual" rel="nofollow noreferrer">POCO Data</a> library, which supports ODBC, MySQL and SQLite. Part of the free open source <a href="http://pocoproject.org" rel="nofollow noreferrer">POCO C++ Libraries</a>.</p>\n'}, {'answer_id': 10654970, 'author': 'herzbube', 'author_id': 1054378, 'author_profile': 'https://Stackoverflow.com/users/1054378', 'pm_score': 1, 'selected': False, 'text': "<p>Although this question and its answers are several years old, they are still valuable for people like me that cruise by on an evaluation trip. For this reason, I would like to add the Qt C++ framework's <code>QtSql</code> module as an option for database connectivity.</p>\n\n<p>Note that I am familiar with Qt in general, but have no experience with <code>QtSql</code> in particular.</p>\n\n<p><strong>Pros (just a few that should also apply if you just choose Qt for its QtSql module):</strong> Qt is cross-platform. In my experience, Qt is well-designed, pretty intuitive to use, and extremely well documented. It has been around for a long time, is maintained by an active community and backed by Nokia, so it won't become unavailable over night. Since 2009, Qt has been licensed under the LGPL, so it is a real no-cost option even for commercial applications.</p>\n\n<p><strong>Cons:</strong> Qt is not small. You will introduce new types such as <code>QString</code> to your project. Qt is licenced under the LGPL, so you need to acknowledge its use even in commercial apps.</p>\n"}]
['https://Stackoverflow.com/questions/50120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5237/']