IExpressionStore::GetExpression Method
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Use this method to retrieve an ADO hierarchical Recordset object that contains the specified expression.
HRESULT IExpressionStore::GetExpression(
long nExprID,
_Recordset** ppRSExpr
);
Function GetExpression(
nExprID As Long
) As Object
Parameters
nExprID
[C++][in] A long that contains the unique identifier of the expression.
[Visual Basic]
A Long that contains the unique identifier of the expression.
ppRSExpr
[C++][out, retval] An address of a pointer to an ADO hierarchical Recordset object that contains the expression.
Return Value
[C++]
This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details. If the method does not complete successfully, the address of the pointer to the Recordset object is set to NULL.
[Visual Basic]
This method returns an ADO hierarchical Recordset object. If successful, the Recordset object contains the specified expression. If unsuccessful, the Recordset object is set to Nothing.
Error Values
[C++]
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.
[Visual Basic]
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 |
0x8110001F &H8110001F |
Invalid connection |
E_EXPR_BADEXPRID |
0x8110000A &H8110000A |
Invalid expression ID specified, or expression ID not found in store |
E_EXPR_NOCONNECTIONSTRING |
0x8110000D &H8110000D |
No connection string specified |
[C++]
Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
[Visual Basic]
Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
To access all expressions in the connected expression store, use the GetAllExprs method.
Call the Connect method before calling the GetExpression method.
The ppRSExps parameter contains valid data only if the method completes successfully.
See Also
Other Resources
IExpressionStore::Connect Method