IExpressionStore::SaveExpression Method [C++]

Use this method to save a new or modified expression to the expression store. For a new expression, the SaveExpression method automatically generates a unique expression ID and stores it with the expression.

Definition

[C++]

HRESULT IExpressionStore::SaveExpression(_Recordset*pRSExpr);

[Visual Basic]

Sub SaveExpression(pRSExpr As Object)

Parameters

  • pRSExpr[C++]
    [in] A pointer to the ADO hierarchical Recordset object that contains the expression.
  • pRSExpr[Visual Basic]
    [in] A Recordset object that contains the expression.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] None.

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

[C++] 0x8110001F

[Visual Basic] &H8110001F

Invalid connection
E_EXPR_BADEXPRBODY

[C++] 0x81100004

[Visual Basic] &H81100004

Invalid or missing expression body
E_EXPR_BADEXPRCATEGORY

[C++] 0x8110000A

[Visual Basic] &H8110000A

Invalid expression category specified
E_EXPR_BADEXPRNAME

[C++] 0x81100003

[Visual Basic] &H81100003

Invalid expression name
E_EXPR_CYCLEDETECTED

[C++] 0x81100006

[Visual Basic] &H81100006

A cycle was detected in the expression dependencies of this expression
E_EXPR_DUPEXPRDEPS

[C++] 0x81100009

[Visual Basic] &H81100009

Duplicate expression dependency
E_EXPR_DUPEXPRNAME

[C++] 0x81100007

[Visual Basic] &H81100007

Duplicate expression name
E_EXPR_DUPPROFDEPS

[C++] 0x81100008

[Visual Basic] &H81100008

Duplicate profile dependency
E_EXPR_INVALIDEXPRDEPS

[C++] 0x8110000B

[Visual Basic] &H8110000B

One or more of the expression dependencies refers to an expression ID that does not exist
E_EXPR_INVALIDFIELDSIZE

[C++] 0x81100005

[Visual Basic] &H81100005

The new name exceeds the maximum size of 30 characters
E_EXPR_NOCONNECTIONSTRING

[C++] 0x8110000D

[Visual Basic] &H8110000D

No connection string specified
E_EXPR_NOPROFDEPS

[C++] 0x81100002

[Visual Basic] &H81100002

Expression must have at least one profile-dependency to be saved

[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

[C++] If the expression being saved is not currently in the expression store, the SaveExpression method generates a unique identifier and populates the ExprID field of the Recordset object. The identifier is a positive integer. For more information about the format and fields of the Recordset object, see Expression Recordset.

[Visual Basic] If the expression being saved is not currently in the expression store, the SaveExpression method generates a unique identifier and populates the ExprID field of the Recordset object. The identifier is a positive integer. For more information about the format and fields of the Recordset object, see Expression Recordset.

The ExpressionStore object performs rudimentary checks for expression dependencies when an expression is saved or deleted. This includes any direct references, a test for cyclic referencing, and any references to non-existent expressions.

Call the Connect method before calling the SaveExpression method.

See Also

[C++]ExpressionStore Object

[C++]IExpressionStore::Connect

[C++]IExpressionStore::GetExpression

[C++]IExpressionStore::NewExpression

[Visual Basic]ExpressionStore Object

[Visual Basic]ExpressionStore.Connect

[Visual Basic]ExpressionStore.GetExpression

[Visual Basic]ExpressionStore.NewExpression

Copyright © 2005 Microsoft Corporation.
All rights reserved.