CatalogManager.ExportCSV

Ee799748.c++_on(en-US,CS.10).gifEe799748.vb_off(en-US,CS.10).gif

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

Definition

Sub ExportCSV(strCSVDestination As String,strCatalogToExport As StringfRunSynchronously As Boolean)

Parameters

strCSVDestination

A String that contains the full path and file name of the export file to be created.

strCatalogToExport

A String that contains the name of the catalog to export.

fRunSynchronously

A Boolean 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

None.

Error Values

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_CAT_IMPORT_IN_PROGRESS &H88980025 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 &H88980018 The method was unable to create the output file.

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 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.

Ee799748.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.

Ee799748.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.

Example

myCatalogManager.ExportCSV "c:\exports\ourcatalog.csv", "OurStore"

See Also

CatalogManager Object

CatalogManager.ExportXML

CatalogManager.ImportCSV


All rights reserved.