Export (0) Print
Expand All
ExpressionStore.Connect Method
ExpressionStore.DeleteExpression Method
ExpressionStore.Disconnect Method
ExpressionStore.Export Method
ExpressionStore.GetAllExprs Method
ExpressionStore.GetExpression Method
ExpressionStore.GetExprID Method
ExpressionStore.GetExprName Method
ExpressionStore.Import Method
ExpressionStore.NewExpression Method
ExpressionStore.Query Method
ExpressionStore.RenameExpression Method
ExpressionStore.SaveExpression Method
Expand Minimize

IExpressionStore::Import Method [C++]

Commerce Server 2002

Use this method to import expressions from a file into the expression store.

Definition

[C++]
HRESULT IExpressionStore::Import(
 BSTR bstrFileName
);
[Visual Basic]
Sub Import(
 bstrFileName As String
)

Parameters

bstrFileName [C++]
[in] A BSTR that contains the path and name of the file from which to import the expressions.
bstrFileName [Visual Basic]
[in] A String that contains the path and name of the file from which to import the expressions.

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.

ConstantValueDescription
E_EXPR_BADCONNECTION

[C++] 0x8110001F

[Visual Basic] &H8110001F

Invalid connection
E_EXPR_NOCONNECTIONSTRING

[C++] 0x8110000D

[Visual Basic] &H8110000D

No connection string specified
E_EXPR_NONEMPTYSTORE

[C++] 0x8110000C

[Visual Basic] &H8110000C

Cannot import to a non-empty store

[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

The expression store must be empty in order to import expressions.

The import file must contain the XML schema for the expression recordset followed by the XML representation of each expression recordset. Expression recordsets with invalid expression bodies are imported but will cause an error upon evaluation.

Use the Export method to copy the XML schema for the expression recordset and all the expressions from the expression store to a file.

Call the Connect method before calling the Import method.

[Visual Basic]

Example

' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.

oExpressionStore.Import "\SomePath\Expressions.xml"

See Also

[C++] Expression Recordset

[C++] Expression XML Structures

[C++] ExpressionStore Object

[C++] IExpressionStore::Export

[Visual Basic] Expression Recordset

[Visual Basic] Expression XML Structures

[Visual Basic] ExpressionStore Object

[Visual Basic] ExpressionStore.Export

Copyright © 2005 Microsoft Corporation.
All rights reserved.
Show:
© 2014 Microsoft