IViewFilter::GetFilter

OLE DB Programmer's Reference

Retrieves the filter applied to a view.

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 once 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" in Chapter 6: Getting and Setting Data.
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" in Chapter 6: Getting and Setting Data.

Comments

None.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net