次の方法で共有


IViewFilter::GetFilter

Retrieves the filter applied to a view.

Syntax

HRESULT GetFilter (
   HACCESSOR       hAccessor,
   DBCOUNTITEM    *pcRows,
   DBCOMPAREOP    *pCompareOps[],
   void           *pCriteriaData);

Parameters

  • hAccessor
    [in] A row data accessor describing the data to be written to ppCriteriaData. The same column may appear more than one time in the criteria.

  • pcRows
    [out] A pointer to memory in which to write the number of rows in the criteria table, where the criteria described by each row is joined in a logical OR with the other rows. If pcRows is greater than one, the cbRowSize argument used in the call to IAccessor::CreateAccessor is used to specify the offset between each set of row values.

  • pCompareOps
    [out] A pointer to memory in which to write a two-dimensional array of comparisons operators. The two-dimensional array contains pcRows by cBindings comparison operators in pcRows-major format, where cBindings is the number of columns represented in hAccessor, and is written in row-major format. Each comparison operator in the cBindings dimension refers to a column in pCriteriaData, and each set of columns in the pcRows dimension refers to a row in pCriteriaData. Columns within a row are joined together in a logical AND, and each row is joined in a logical OR with another row. For information about the DBCOMPAREOP enumerated type, see IRowsetFind::FindNextRow.

    Note

    If the consumer set the filter using IViewFilter::SetFilter, it knows the maximum size of the comparison operator array and can allocate memory for it accordingly. If the consumer was passed the view, it needs to allocate sufficiently large buffers to hold these arrays.

  • pCriteriaData
    [out] A pointer to a buffer in which to return the criteria data.

    Note

    If the consumer set the filter using IViewFilter::SetFilter, it knows the maximum size of the criteria data array and can allocate memory for it accordingly. If the consumer was passed the view, it needs to allocate sufficiently large buffers to hold these arrays.

Return Code

  • S_OK
    The method succeeded.

  • DB_S_ERRORSOCCURRED
    An error occurred while returning data for one or more columns, but data was successfully returned for at least one column. To determine the columns for which data was returned, the consumer checks the status values. For a list of status values that can be returned by this method, see "Status Values Used When Getting Data" in Status.

  • E_FAIL
    A provider-specific error occurred.

  • E_OUTOFMEMORY
    The provider was unable to allocate sufficient memory in which to return the filter information.

  • DB_E_BADACCESSORHANDLE
    hAccessor was invalid. Providers are required to check for this condition in this method.

  • DB_E_BADACCESSORTYPE
    The specified accessor was not a row accessor.

  • DB_E_BADCOMPAREOP
    In an element of pCompareOps, both DBCOMPAREOPS_CASESENSITIVE and DBCOMPAREOPS_CASEINSENSITIVE were specified.

    The provider was asked for an option that it does not support.

  • DB_E_ERRORSOCCURRED
    Errors occurred while returning data for all columns. To determine what errors occurred, the consumer checks the status values. For a list of status values that can be returned by this method, see "Status Values Used When Getting Data" in Status.

Comments

None.