PRB: MSDASQL Incorrectly Matches Parameter Names with an Empty String (306744)



The information in this article applies to:

  • Microsoft Data Access Components 1.5
  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
  • Microsoft Data Access Components 2.7

This article was previously published under Q306744

SYMPTOMS

When the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL) calls IDBSchemaRowset::GetRowset to retrieve DBSCHEMA_PROCEDURE_PARAMETERS with the PARAMETER_NAME restriction set to an empty string, the provider may incorrectly match the empty string with some parameter name and return rows instead of an empty rowset.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

To reproduce this behavior, use the RowsetViewer tool (which ships with the Microsoft Data Access SDK 2.6) to connect to an ODBC data source by way of the Microsoft OLEDB Provider for ODBC drivers (MSDASQL).
  1. From the Session menu, invoke IDBSchemaRowset and GetRowset.
  2. On the invoked dialog box, select DBSCHEMA_PROCEDURE_PARAMETERS from the drop-down list under the Schema tab.
  3. The first three restrictions should be VT_EMPTY while the fourth, PARAMETER_NAME, VT_BSTR, should be set to <Empty String> by selecting it from the drop-down list.
  4. Click OK.
Some rows are displayed. An empty rowset is the expected result because the provider should not find any procedure that has parameters with an empty string.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbprb KB306744