Chapter Thirty-Three

The OLE DB Templates

Chapter 31 and Chapter 32 covered two alternative ways to manage databases using the Microsoft Foundation Class Library version 6.0 and Microsoft Visual C++ 6.0—using ODBC and using DAO. Microsoft has defined another way to access data—through a technology called OLE DB. This chapter covers the new OLE DB templates—Visual C++ 6.0's support for accessing data through OLE DB directly. While ODBC is designed to provide access primarily to Structured Query Language (SQL) data in a multiplatform environment, OLE DB is designed to provide access to all types of data within a system. OLE DB uses the Component Object Model (COM) to accomplish this. OLE DB is fairly flexible: it covers all the SQL functionality defined in ODBC as well as defining interfaces suitable for gaining access to other-than-SQL types of data.

This chapter covers the highlights of the new OLE DB templates. OLE DB data access is divided into two major pieces: consumers and providers. We'll take a look at the basic OLE DB architecture and then examine how the consumer templates work. Then we'll look at how the provider side templates work.