--- title: nanodbc --- nanodbc
View on GitHub API Documentation


A small C++ wrapper for the native C ODBC API.

Download this project as a .zip file Download this project as a tar.gz file

Documentation for nanodbc v2.12.4


Here's a before and after look at straight ODBC C API code and its equivalent nanodbc code.

C API Straight ODBC
nanodbc Using nanodbc


Originally nanodbc began as a simple fork of TinyODBC with additional features. Eventually it grew to the point where it made sense to break with many of the basic underlaying design decisions of TinyODBC and completely refactor much of the codebase. Other projects that have had influence on nanodbc include SimpleDB, pyodbc, Database Template Library, and GSODBC.

For for information on library usage, see the source level documentation courtesy of Doxygen! And for all the gory details of building nanodbc, or the source itself, visit nanondbc on GitHub.

Why should you use nanodbc?

  • Small! Same as TinyODBC, nanodbc is small. A header and an implementation file.
  • Simple! There are only a handful of significant classes to learn.
  • Portable! nanodbc uses only standard C++ headers in addition to the ODBC API headers.
  • Robust! Where it makes sense, error handling is done with exceptions instead of return codes.
  • Features! nanodbc supports ODBC 3, SQLDriverConnect(), Transactions, Bound Parameters, Bulk Operations, and much more.
  • Documented! I have tried to provide very clean and useful documentation with example usage.
  • Active! I am currently actively using and developing nanodbc so I hope to add more and more features all the time.

Version Information

Version Description
release release Most recent release that's been deemed "stable". Always prefer to use this version if you can!
latest latest Latest release; still needs testing to be deemed "stable". See all available releases.
master master Contains the latest development code, not yet ready for a release.
v2.x.x Targets C++14+. All future development will build upon this version.
v1.x.x Supports C++03 and optionally C++11. There is no longer any support for this version.

Example usage

{% highlight cpp %} {% include example.cpp %} {% endhighlight %}


nanodbc is Open Source Software and very accepting of bug fixes and new features. Please consider contributing any changes you make or reporting any issues you have. Cheers!