Naughter Software Logo

ODBCWrappers v1.22 A set of C++ classes to encapsulate ODBC on Windows

The classes provided are: CODBC::CHandle, CODBC::CEnvironment, CODBC::CConnection, CODBC::CStatement & CODBC::CDescriptor.

CHandle provides a class based encapsulation of a SQLHANDLE handle and the various ODBC v3 APIs which work on any SQLHANDLE type handle.

CEnvironment derives from CHandle and provides encapsulation of a ODBC environment handle. This class allows configuration of ODBC for initial usage and creation of connections to a database

CConnection derives from CHandle and provides encapsulation of a logical connection to a database.

CStatement derives from CHandle and provides encapsulation of an ODBC "statement" which allows execution of commands against a ODBC connection.

CDescriptor derives from CHandle and provides encapsulation of an ODBC "descriptor".

Finally ODBCWrappers provides a framework which provides accessor maps similar to the macros provided by the built in Visual C++ ATL OLE DB Consumer templates. These provide a simple mapping from code using OLE DB and these templates to equivalent ODBC functionality. This should provide a easy migration path if you want to move your OLE DB code to ODBC. Similar to the OLE DB classes, both static accessors (CODBC::CAccessor) and dynamic accessors (CODBC::CDynamicColumnAccessor) are supported. In 2011 Microsoft decided to deprecate OLE DB and this decision was one of the driving reasons to implement ODBCWrappers in the first place as the only ODBC classes available in Visual C++ are MFC specific (CDatabase/CRecordSet etc) and in-line with Microsoft's strategy it really does not make sense to restrict our usage of ODBC to MFC specific use cases going forward. The development of ODBCWrappers took a number of months of hard work researching, developing and testing and hopefully you should find them useful in your C++ database programming efforts. In 2018 Microsoft decided to un-deprecate OLE DB!

 

Features

 

The enclosed zip file contains the ODBCWrappers source code and a VC 2017 console based application which demonstrates most of the classes functionality. To run correctly, this sample requires that a PJ_Test stored procedure is created from the included "Create PJ_Test SP.sql" script against a local installed instance of the sample AdventureWorks 2008 sample database from Microsoft.

 

Copyright

 

Updates

v1.22 (15 December 2023)

v1.21 (12 May 2023)

v1.20 (4 March 2022)

v1.19 (3 July 2021)

v1.18 (13 October 2020)

v1.17 (9 October 2020)

v1.16 (20 September 2020)

v1.15 (13 April 2020)

v1.14 (2 March 2020)

v1.13 (19 December 2019)

v1.12 (1 October 2019)

v1.11 (14 April 2019)

v1.10 (28 November 2018)

v1.09 (3 December 2017)

v1.08 (29 April 2017)

v1.07 (5 November 2015)

v1.06 (14 March 2015)

v1.05 (27 February 2015)

v1.04 (21 February 2013)

v1.03 (19 February 2013)

v1.02 (20 November 2011)

v1.01 (16 November 2011)

v1.0 (13 November 2011)