The OLE DB provider architecture includes a data source object and one or more sessions. The data source object is the initial object every provider must instantiate. When a consumer application needs data, it cocreates the data source object to start the provider. The data source object creates a session object (using the IDBCreateSession interface) through which the consumer connects to the data source object. ODBC programmers can think of the data source object as being equivalent to the HENV and the session object as equivalent to the HDBC.
Together with the source files created by the OLE DB Provider Template Wizard, the OLE DB Templates implement a data source object. A session is an object that corresponds to the OLE DB TSession.
There are mandatory and optional interfaces defined by OLE DB for several types of objects: