Microsoft Knowledge Base Email Alertz

When you retrieve a schema rowset from an OLE DB provider created using the ATL OLE DB Provider Wizard, the TABLE_CATALOG and TABLE_SCHEMA columns return a status of DBSTATUS_S_OK and a zero length DBTYPE_WSTR value. According to the OLE D

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 217186 - Last Review: April 22, 2003 - Revision: 1.2

FIX: Default Schema Rowsets Do Not Return NULL Columns

This article was previously published under Q217186

SYMPTOMS

When you retrieve a schema rowset from an OLE DB provider created using the ATL OLE DB Provider Wizard, the TABLE_CATALOG and TABLE_SCHEMA columns return a status of DBSTATUS_S_OK and a zero length DBTYPE_WSTR value. According to the OLE DB specification 2.0. If a provider does not support the IDBInfo interface (and a default ATL OLE DB Provider Wizard generated OLE DB provider does not), then the provider must return DBSTATUS_S_ISNULL for all TABLE_CATALOG and TABLE_SCHEMA columns in schema rowsets.

STATUS

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:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why  (http://kbalertz.com/Feedback.aspx?kbNumber=194022/EN-US/ )

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed  (http://kbalertz.com/Feedback.aspx?kbNumber=194295/EN-US/ )

MORE INFORMATION

The following information is taken from the OLE DB Programmer's Reference, Appendix B Schema Rowsets.

"If a provider returns non-NULL CATALOG or SCHEMA column values in schema rowsets, it must support IDBInfo to describe how a fully qualified name is assembled. A provider that does not support IDBInfo must return NULL values for CATALOG and SCHEMA columns in all schema rowsets."

Since an ATL OLE DB Provider Wizard generated OLE DB provider does not support the IDBInfo interface, it does not follow the OLE DB specification when it returns zero length strings in the TABLE_CATALOG and TABLE_SCHEMA schema rowset columns.

You can test a particular ATL OLE DB Provider as seen below, by using the RowsetViewer tool that ships with the Microsoft Data Access SDK 2.0.

  1. Open RowsetViewer.
  2. Point to Select File and click Full Connect.
  3. Select your ATL OLE DB Provider Wizard generated OLE DB provider in the Provider drop down menu and click OK.
  4. Point to Select Session and click IDBSchemaRowset and GetRowset.
  5. Select DBSCHEMA_TABLES and click OK.
  6. Double-click the single returned row and check the status flags for the TABLE_CATALOG and TABLE_SCHEMA columns.

If the status flags are set to DBSTATUS_S_ISNULL, the Provider is displaying the correct behavior. If the status flags are set to DBSTATUS_S_OK, the Provider is not following the OLE DB 2.0 specification.

REFERENCES

The Microsoft Data Access SDK 2.1 Online Documentation: Microsoft OLE DB; OLE DB Programmer's Reference; Part 3 Appendixes; Appendix B Schema Rowsets.

APPLIES TO
  • Microsoft OLE DB 2.7, when used with:
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords: 
kbbug kbdatabase kbdtl kbfix kbprovider kbvs600sp3fix KB217186
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate