Share via


ICatalogManager::ExportCSV

Ee799752.c++_off(en-US,CS.10).gifEe799752.vb_on(en-US,CS.10).gif

Use this method to export catalog data to a comma-separated values format file.

Definition

HRESULT ICatalogManager::ExportCSV(BSTRstrCSVDestination,BSTRstrCatalogToExportVARIANT_BOOLfRunSynchronously);

Parameters

strCSVDestination

[in] A BSTR that contains the full path and file name of the export file to be created.

strCatalogToExport

[in] A BSTR that contains the name of the catalog to export.

fRunSynchronously

[in, defaultvalue (0)] A VARIANT_BOOL that specifies whether the method should be run synchronously. A value of True indicates that the method will not return until the export is completed. A value of False indicates that the method will return immediately after spawning the export thread.

Return Values

This method returns an HRESULT indicating it completed successfully.

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_CAT_IMPORT_IN_PROGRESS 0x88980025 There was an existing import method call that had not yet completed. This method cannot run while an import is in progress.
E_CAT_FILE_CREATION_FAILED 0x88980018 The method was unable to create the output file.

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

The ExportCSV method can be used to output product data from the Product Catalog System in a format that can be used in other programs, such as Microsoft Excel.

This method can only output product data from one catalog at a time.

The comma-separated values (CSV) file generated only contains products. The categories, relationships, and hierarchy are not written to the CSV file.

Ee799752.note(en-US,CS.10).gifNote

  • This method runs in a separate thread. Prior to spawning the thread, it checks that there is not an existing ExportCSV, ExportXML, ImportCSV or ImportXML method in progress. Once the new thread is spawned, this method returns immediately, if fRunSynchronously is False, with no errors. Any errors that occurred while importing the catalog are logged to the Windows NT Event Log. Use the Windows Event Viewer to view the Windows NT Event Log.

  • If there is a temporary loss of the SQL connection, longer than two minutes, an import or export will be aborted. Other methods should work after the interruption.

Ee799752.note(en-US,CS.10).gifCaution

  • Changes made to the catalog while an export is in progress may or may not be reflected in the output file. Additions and deletions made during the export could result in a corrupt file. Changes should be avoided during an export.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

See Also

CatalogManager Object

ICatalogManager::ExportXML

ICatalogManager::ImportCSV


All rights reserved.