IExpressionStore::DeleteExpression Method [C++]

Use this method to delete an existing expression from the expression store.

Definition

[C++]

HRESULT IExpressionStore::DeleteExpression(longnExprID,
 longflags);

[Visual Basic]

Sub DeleteExpression(nExprID As Long,
 flags As Long)

Parameters

  • nExprID[C++]
    [in] A long that specifies the expression to be deleted.
  • nExprID[Visual Basic]
    [in] A Long that specifies the expression to be deleted.
  • flags[C++]
    [in] A long that contains the optional control flags. This parameter is currently unused and should be set to zero (0).
  • flags[Visual Basic]
    [in] A Long that contains the optional control flags. This parameter is currently unused and should be set to zero (0).

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_BADEXPRID

[C++] 0x8110000A

[Visual Basic] &H8110000A

Invalid expression ID specified, or expression ID not found in store
E_EXPR_EXPRDELFAILED

[C++] 0x81100010

[Visual Basic] &H81100010

Delete operation failed, possibly due to other expressions having dependencies on this expression
E_EXPR_NOCONNECTIONSTRING

[C++] 0x8110000D

[Visual Basic] &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

If the specified expression has a non-zero reference count, meaning that other expressions depend on the specified expression, the expression is not deleted.

Call the Connect method before calling the DeleteExpression method.

[Visual Basic]

Example

' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.
' 59552 is a valid expression ID retrieved by the GetExprID method.

oExpressionStore.Delete(59552, 0)

See Also

[C++]ExpressionStore Object

[C++]IExpressionStore::Connect

[C++]IExpressionStore::NewExpression

[Visual Basic]ExpressionStore Object

[Visual Basic]ExpressionStore.Connect

[Visual Basic]ExpressionStore.NewExpression

Copyright © 2005 Microsoft Corporation.
All rights reserved.