IExpressionStore::Export Method
Use this method to export the expressions stored in the expression store to a file.
HRESULT IExpressionStore::Export(
BSTR bstrFileName
);
Sub Export(
bstrFileName As String
)
Parameters
bstrFileName
[C++][in] A BSTR that contains the name of the file used to store the expressions.
[Visual Basic]
A String that contains the name of the file used to store the expressions.
Return Value
[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 |
0x8110001F &H8110001F |
Invalid connection |
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
The file being exported to should not exist prior to the call or the method will fail. If an absolute path is not specified, the file is placed in the \WINNT\system32 folder.
After the method successfully completes, the file contains the XML schema for the expression recordset followed by the XML representation of each expression recordset in the expression store.
Use the Import method to copy the expressions in a file to the expression store.
Call the Connect method before calling the Export method.
Example
' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.
oExpressionStore.Export "Expressions.xml"