CatalogManager.ImportXML

Ee799846.c++_on(en-US,CS.10).gifEe799846.vb_off(en-US,CS.10).gif

Use this method to import an Extensible Markup Language (XML) file as catalog data.

Definition

Sub ImportXML(strXMLFilePath As String,fUpdateOnly As BooleanfRunSynchronously As Boolean)

Parameters

strXMLFilePath

A String that contains the path and file name of the XML file to import.

fUpdateOnly

A Boolean that specifies whether to update an existing catalog or create a new one. A value of True indicates that if the system contains a catalog whose name is the same as the one specified in the strCatalogName parameter, it will be updated with the imported data. A value of False indicates to delete the catalog if it already exists and create a new one with the imported data.

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 import is completed. A value of False indicates that the method will return immediately after spawning the import 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_OPEN_ERROR &H88980020 The method was unable to open the 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

When performing a partial or delta import (when updating an existing catalog by importing new or changed catalog data), it is important that the schema of the data being imported matches the schema of the existing catalog. For more information about the catalog schema, see Import Semantic.

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

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

  • This method runs in a separate thread. Prior to spawning the thread, it checks that the specified file can be opened and that there is not an existing ExportCSV, ExportXML, ImportCSV or ImportXMLmethod 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.

  • This method cannot be called in a transacted object. This method involves the creation, deletion, or updating of free text indexes. SQL Server does not allow these operations in a transaction.

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

  • The names of catalogs in the source file cannot begin with "#" or consist solely of spaces.

  • If a property existing in the catalog has one type and the property of the same name existing in the import file has a different type, the import will fail. For example, the catalog has a SKU property that is a string, and the XML file being imported has a SKU property that is an integer. This will cause an error.

Example

myCatalogManager.ImportXML "c:\imports\ourcatalog.xml", TRUE

See Also

CatalogManager Object

CatalogManager.ExportXML

CatalogManager.ImportCSV


All rights reserved.