Article ID: 217181 - View products that this article applies to.
This article was previously published under Q217181
This article has been archived. It is offered "as is" and will no longer be updated.
If you use the default PROVIDER_COLUMN_ENTRY macro when creating an OLE DB Provider using the Active Template Library (ATL) OLE DB Provider template classes, the DBID of each column is set to DBKIND_GUID_NAME rather than DBKIND_NAME.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/194022/EN-US/ )INFO: Visual Studio 6.0 Service Packs, What, Where, Why
(http://support.microsoft.com/kb/194295/EN-US/ )HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
The PROVIDER_COLUMN_ENTRY macro creates a columnid value for each column in your provider's rowset. The columnid is a DBID structure, which allows the use of a GUID plus either a string or an unsigned long integer to identify the column. The DBID structure also contains a flag (DBKIND eKind), which is an enumerated value that indicates which part of the DBID structure to use as the identifier for the column.
The PROVIDER_COLUMN_ENTRY macro sets each column's DBID GUID to a null GUID and also assigns the string identifier (LPWSTR pwszName) using the name of the column. The macro also sets DBID.eKind to DBKIND_GUID_NAME, which indicates to OLE DB that you can use either the GUID or the name part of the DBID structure to identify the column.
The expected value for the DBID is DBKIND_NAME because the GUID value for each of the columns is set to a NULL GUID. Since all of the GUID values are null, they are not useful as a means to identify the column.
The updated ATL OLE DB Provider header file atldb.h installed by Visual C++ Service Pack 3 uses DBKIND_NAME for the DBID.eKind value in the PROVIDER_COLUMN_ENTRY rather than DBKIND_GUID_NAME.
Article ID: 217181 - Last Review: February 21, 2014 - Revision: 2.0