IExpressionEval::Connect
Use this method to establish communication with an expression store.
Definition
HRESULT IExpressionEval::Connect(VARIANTvConnectInfo);
Parameters
vConnectInfo
[in] A VARIANT that describes the expression store connection data. This may be a BSTR containing the connection information or a pointer to an existing ExpressionStore object.
Return Values
This method returns an HRESULT indicating whether 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_BADEXPRSTORE | 0x8110001E | Specified database does not contain a valid expression store |
E_EXPR_NOCONNECTIONSTRING | 0x8110000D | No connection string specified |
E_EXPR_STOREPERMISSIONS | 0x8110000F | Insufficient access permissions on the expression store database |
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.
Remarks
If a connection string is passed as the input parameter, the ExpressionEval object creates an ExpressionStore object that uses the connection string to access the expression store. Upon destruction, the ExpressionEval object destroys the ExpressionStore object.
The connection string for the expression store may be obtained through the SiteConfigReadOnly object or through the Commerce Server Manager console from the s_BizDataStoreConnectionString property under the key "Commerce Server Manager\Global Resources\Profiles".
The Connect method must be used before loading or evaluating expressions.
The ParseXML method and the flush methods may be used without connecting to an expression store.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.