Creating the Data Source Object - OLE DB Provider for Teradata

OLE DB Provider for Teradata User Guide

Product
OLE DB Provider for Teradata
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
dita:id
B035-2498
Product Category
Teradata Tools and Utilities

Creating the Data Source Object

To connect to the Teradata Database, a consumer must first create and initialize an instance of a Data Source object for OLE DB Provider for Teradata.

Example – Visual C++

The following Visual C++ code fragment shows how to create a Data Source object for OLE DB Provider for Teradata:

 
// Retrieving the class id
hr = CLSIDFromProgID(L"TDOLEDB", &clsid);
 
hr = CoCreateInstance(clsid, 
                      NULL, 
                      CLSCTX_INPROC_SERVER, 
                      NULL, 
                      IID_IDBInitialize, 
                      (IUnknown **)&pIDBInitialize);

The Program ID for OLE DB Provider for Teradata is TDOLEDB.

  • This program uses TDOLEDB to retrieve the Class ID.
  • This program uses the Class ID to create the instance of the Data Source object.