IExpressionStore::Query

Ee784691.c++_off(en-US,CS.10).gifEe784691.vb_on(en-US,CS.10).gif

Use this method to retrieve a Recordset object containing expressions that match the specified query conditions. At least one of the optional arguments must be specified.

Definition

HRESULT IExpressionStore::Query(VARIANTvName,VARIANTvCategory,VARIANTvProfiles,_Recordset**ppRSExprs);

Parameters

vName

[in, optional] When specified, a BSTR name to match expressions against. This is used in an SQL LIKE clause that permits wildcards.

vCategory

[in, optional] When specified, a BSTR containing the category or SAFEARRAY of category strings to match expressions against. This is used in an SQL LIKE clause that permits wildcards.

vProfiles

[in, optional] When specified, a BSTR containing the profile name or SAFEARRAY of profile names to match expressions against. Profile names must be specified without wildcards.

ppRSExprs

[out, retval] An address of a pointer to a Recordset object that contains the result set of expressions. On failure, the pointer to the Recordset object will be set to NULL.

Return Values

This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_EXPR_BADCONNECTION 0x8110001F Invalid connection
E_EXPR_NOCONNECTIONSTRING 0x8110000D No connection string specified

Remarks

If a combination of the optional parameters is specified, the retrieved expressions satisfy all constraints (implicit AND applied). For example, if name = "Robert%" and category = "General", only expressions with names starting with "Robert" and with a category of "General" will be returned.

When multiple profile names are specified, the query result includes expressions with profile requirements (dependencies) that include any of the listed profile names (implicit OR applied). Thus, if name = "Robert%" and the profiles "User" and "Context" are specified as profiles, the Query method will return all expressions with names starting with "Robert" and profiles requiring only "User", only "Context", or both "User" and "Context".

For details on the ADO Recordset object that represents the expression, see Expression Recordset.

Call the Connect method before calling the Query method.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

The ppRSExprs parameter contains valid data only if the method completes successfully.

See Also

ExpressionStore Object

IExpressionStore::Connect


All rights reserved.