BUG: IDBSchemaRowset::GetRowset Returns Wrong Table Catalog Name Using SQLOLEDB with Server Cursor (294132)



The information in this article applies to:

  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
  • Microsoft Data Access Components 2.7

This article was previously published under Q294132

SYMPTOMS

If you call IDBSchemaRowset::GetRowset using SQLOLEDB and a Server cursor (using DBPROP_SERVERCURSOR), you may receive an incorrect Table Catalog name.

RESOLUTION

You can work around this problem by not using a server cursor if you are going to use the Table Catalog information in your application.

This problem only affects the Table Catalog information. All other information returned by IDBSchemaRowset will be from the requested database regardless of cursor location.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Using RowsetViewer, establish an OLEDB session with SQL Server. Make sure that the current catalog for that session is the master database.
  2. Invoke the IDBSchemaRowset::GetRowset function from the Session menu.
  3. Select rguidSchema = DBSCHEMA_TABLES from the drop down list.
  4. Type "pubs" in the TABLE_CATALOG field.
  5. Click Properties.
  6. Set DBPROP_SERVERCURSOR to TRUE.
  7. Make sure that Use restriction and use properties are selected. The resultset will contain information from the pubs database but the TABLE_CATALOG column will show "master".

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbbug kbpending KB294132