FIX: CTABLESRow Missing TABLE_PROPID Column

Article translations Article translations
Article ID: 201387
Expand all | Collapse all

Symptoms

The OLE DB Provider Templates define the following class to implement the OLE DB's TABLES rowset (please note that this definition of this class is incomplete):
class CTABLESRow
{
public:

   WCHAR m_szCatalog[129];
   WCHAR m_szSchema[129];
   WCHAR m_szTable[129];
   WCHAR m_szType[129];
   WCHAR m_szDesc[129];
   GUID  m_guid;

   CTABLESRow()
   {

      m_szCatalog[0] = NULL;
      m_szSchema[0] = NULL;
      m_szTable[0] = NULL;
      m_szType[0] = NULL;
      m_szDesc[0] = NULL;
      m_guid = GUID_NULL;

   }

BEGIN_PROVIDER_COLUMN_MAP(CTABLESRow)

   PROVIDER_COLUMN_ENTRY("TABLE_CATALOG", 1, m_szCatalog)
   PROVIDER_COLUMN_ENTRY("TABLE_SCHEMA", 2, m_szSchema)
   PROVIDER_COLUMN_ENTRY("TABLE_NAME", 3, m_szTable)
   PROVIDER_COLUMN_ENTRY("TABLE_TYPE", 4, m_szType)
   PROVIDER_COLUMN_ENTRY("TABLE_GUID", 5, m_guid)
   PROVIDER_COLUMN_ENTRY("DESCRIPTION", 6, m_szDesc)

END_PROVIDER_COLUMN_MAP()

};
				

Cause

A required column, TABLE_PROPID, is missing.

Resolution

To fix the problem, you can modify the CTABLESRow class definition to include TABLE_PROPID. The CTABLESRow class is defined in the Atldb.h file located in the C:\Program Files\Microsoft Visual Studio\VC98\ATL\Include directory.

The following code shows the changes that need to be made:
class CTABLESRow
{
public:

   WCHAR m_szCatalog[129];
   WCHAR m_szSchema[129];
   WCHAR m_szTable[129];
   WCHAR m_szType[129];
   WCHAR m_szDesc[129];
   GUID  m_guid;
   ULONG m_ulPropID;  // Add this line.
   // NOTE:  We don't bind DateCreated and DateModified because 1.x
   // providers do not handle them.

   CTABLESRow()
   {

      m_szCatalog[0] = NULL;
      m_szSchema[0] = NULL;
      m_szTable[0] = NULL;
      m_szType[0] = NULL;
      m_szDesc[0] = NULL;
      m_guid = GUID_NULL;
      m_ulPropID = 0;   // Add this line.

   }

BEGIN_PROVIDER_COLUMN_MAP(CTABLESRow)

   PROVIDER_COLUMN_ENTRY("TABLE_CATALOG", 1, m_szCatalog)
   PROVIDER_COLUMN_ENTRY("TABLE_SCHEMA", 2, m_szSchema)
   PROVIDER_COLUMN_ENTRY("TABLE_NAME", 3, m_szTable)
   PROVIDER_COLUMN_ENTRY("TABLE_TYPE", 4, m_szType)
   PROVIDER_COLUMN_ENTRY("TABLE_GUID", 5, m_guid)
   PROVIDER_COLUMN_ENTRY("DESCRIPTION", 6, m_szDesc)
   PROVIDER_COLUMN_ENTRY("TABLE_PROPID", 7, m_ulPropID) //Add this line.

END_PROVIDER_COLUMN_MAP()

};
				

Status

Microsoft has confirmed that this is a problem 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:
194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

References

Microsoft Developer Network Help; search on: "TABLES rowset"

Properties

Article ID: 201387 - Last Review: December 27, 2013 - Revision: 2.0
Keywords: 
kbbug kbcode kbdatabase kbDSupport kbdtl kbmdacnosweep kbvs600sp3fix KB201387

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com