ExpressionStore.Query

Ee799431.c++_on(en-US,CS.10).gifEe799431.vb_off(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

Function Query(OptionalvName As Variant,Optional vCategory As Variant,Optional vProfiles As Variant) As Object

Parameters

vName

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

vCategory

[in, optional] When specified, a String 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 String containing the profile name or SAFEARRAY of profile names to match expressions against. Profile names must be specified without wildcards.

Return Values

This method returns an ADO hierarchical Recordset object. If successful, the Recordset object contains the result set of expressions. If unsuccessful, the Recordset object is set to Nothing.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM 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 &H8110001F Invalid connection
E_EXPR_NOCONNECTIONSTRING &H8110000D 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.

Example

' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.
' rsExpr is a Recordset object that will contain all expressions
' with a name starting with 'Express', having a category of
' Octogenarians' and a profile dependency on 'joeuser'.

rsExpr = oExpressionStore.Query("Express%", "Octogenarians", "joeuser")

See Also

ExpressionStore Object

ExpressionStore.Connect


All rights reserved.