_BusinessDataAdmin2::ImportCatalogs [C++]

Use this method to import the profile catalog (profile schema) in an XML document to the business data store.

Definition

[C++]

HRESULT _BusinessDataAdmin2::ImportCatalogs(BSTR*sXMLDocument);

[Visual Basic]

Sub ImportCatalogs(sXMLDocument As String)

Parameters

  • sXMLDocument[C++]
    [in] A pointer to a BSTR that contains the XML document containing the profile catalog to be imported.
  • sXMLDocument[Visual Basic]
    A String that contains the XML document containing the profile catalog to be imported.

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.

Constant Value Description
ERR_NOCONNECTION

[C++] 0x800A00BF

[Visual Basic] &H800A00BF

191

No connection is open to the database. The Connect() method should be called first.
ERR_XML_PARSE

[C++] 0x800A007A

[Visual Basic] &H800A007A

122

Parse errors in XML document '%0', line %1, col %2. Reason: %3
ERR_BAD_NAMESPACE

[C++] 0x800A00CB

[Visual Basic] &H800A00CB

203

The xml does not contain the correct namespace.
ERR_MEMBER_INVALID_NEWDELETE

[C++] 0x800A00A2

[Visual Basic] &H800A00A2

162

One or more profile-members have invalid attributes: isNew='1' and isDeleted='1'.
ERR_MISSING_CATALOG

[C++] 0x800A00CD

[Visual Basic] &H800A00CD

205

The file does not contain any catalogs.
ERR_MEMBER_INVALID_NEWMODIFIED

[C++] 0x800A00A4

[Visual Basic] &H800A00A4

164

One or more profile-members have invalid attributes: isNew='1' and isModified='1'.
ERR_INVALID_CATALOG_NAME

[C++] 0x800A00CC

[Visual Basic] &H800A00CC

204

The catalog '%0' is an invalid name.
ERR_CATALOG_DELETEFAILED

[C++] 0x800A0079

[Visual Basic] &H800A0079

121

Cannot delete catalog '%0'. Source: '%1' Reason: '%2'
ERR_CATALOG_EXISTS

[C++] 0x800A006E

[Visual Basic] &H800A006E

110

Catalog '%0' already exists.
ERR_CATALOG_NOTFOUND

[C++] 0x800A0074

[Visual Basic] &H800A0074

116

Cannot find catalog '%0'.
ERR_SOURCE_INVALIDTYPE

[C++] 0x800A00B0

[Visual Basic] &H800A00B0

176

'%0' is not a valid source type.
ERR_NO_SRCINFOS

[C++] 0x800A0087

[Visual Basic] &H800A0087

135

No source-infos were specified for data-source '%0'.
ERR_TOO_MANY_SRCINFOS

[C++] 0x800A0088

[Visual Basic] &H800A0088

136

More than one source-info is specified for non-partitioned data-source '%0'. A non-partitioned data source may only have one source-info.
ERR_NOT_ONE_DEFAULT_SRCINFO

[C++] 0x800A0089

[Visual Basic] &H800A0089

137

One source-info must be marked as default for data-source '%0'.
ERR_TOO_MANY_PARTITIONS

[C++] 0x800A00BA

[Visual Basic] &H800A00BA

186

The data source '%0' contains %1 partitions. A single data source cannot have more than %2 partitions.
ERR_SOURCE_INVALIDNAME

[C++] 0x800A00A9

[Visual Basic] &H800A00A9

169

The data source '%0' cannot be created because the source name contains invalid characters: %1
ERR_DUPLICATE_SOURCENAME

[C++] 0x800A00BD

[Visual Basic] &H800A00BD

189

A Data-Source already exists with the name '%0'.
ERR_SOURCE_EXISTS

[C++] 0x800A0066

[Visual Basic] &H800A0066

102

Error: The Data Source '%0' already exists and cannot be created or modified.
ERR_DUPLICATE_PARTITIONNAME

[C++] 0x800A00BE

[Visual Basic] &H800A00BE

190

A Data-Source partition already exists with the name '%0'.
ERR_SRCINFO_SRCTYPE

[C++] 0x800A00B3

[Visual Basic] &H800A00B3

178

The source type of data-source '%0' cannot be modified.
ERR_SRCINFO_NOTFOUND

[C++] 0x800A008A

[Visual Basic] &H800A008A

138

The source-info '%1' could not be found in data-source '%0'.
ERR_ATTRIBUTE_INVALIDNAME

[C++] 0x800A00A8

[Visual Basic] &H800A00A8

168

The attribute '%0' cannot be created because the attribute name contains invalid characters: %1
ERR_ATTRIBUTE_EXISTS

[C++] 0x800A0085

[Visual Basic] &H800A0085

133

Duplicate names are not allowed: '%0' already exists on '%1'.
ERR_TABLE_INVALIDNAME

[C++] 0x800A00B1

[Visual Basic] &H800A00B1

177

The data object '%0' cannot be created because the object name contains invalid characters: %1
ERR_TABLE_EXISTS

[C++] 0x800A0082

[Visual Basic] &H800A0082

130

The data-object '%0' already exists. (Source '%1', Catalog '%2'.)
ERR_TABLE_NOTFOUND

[C++] 0x800A0083

[Visual Basic] &H800A0083

131

The data-object '%0' could not be found. (Source '%1', Catalog '%2'.)
ERR_COLUMN_EXISTS

[C++] 0x800A007F

[Visual Basic] &H800A007F

127

The data-member '%0' already exists.
ERR_COLUMN_NOTFOUND

[C++] 0x800A007E

[Visual Basic] &H800A007E

126

The data-member '%0' could not be found.
ERR_INVALID_TYPEDEF

[C++] 0x800A0078

[Visual Basic] &H800A0078

120

The data type '%1' for source member '%0' is invalid.
ERR_INVALID_TYPEDEF_FOR_SOURCE

[C++] 0x800A00B7

[Visual Basic] &H800A00B7

183

The data type '%1' for source member '%0' is invalid (data type invalid for source type '%2').
ERR_MEMBER_EXISTS

[C++] 0x800A0077

[Visual Basic] &H800A0077

119

Profile member '%1' cannot be created. A property or group named '%0' already exists within the profile.
ERR_MEMBER_NOTFOUND

[C++] 0x800A0081

[Visual Basic] &H800A0081

129

The profile-member '%0' could not be found.
ERR_MEMBER_NOT_GROUP

[C++] 0x800A007D

[Visual Basic] &H800A007D

125

The profile-member corresponding to group '%0' in the XML document is not a group.
ERR_PRIMARYKEY

[C++] 0x800A00AB

[Visual Basic] &H800A00AB

171

Profile '%0' could not be created/updated because it does not have exactly one primary key defined.
ERR_JOINKEY

[C++] 0x800A00AC

[Visual Basic] &H800A00AC

172

Profile '%0' could not be created/updated because it does not have exactly one join key defined.
ERR_INVALIDTYPE_RDNATTR

[C++] 0x800A00AD

[Visual Basic] &H800A00AD

173

The profile-property '%0' is marked as an RDN-attribute, but is not of type 'STRING'.
ERR_INVALID_HASHKEY

[C++] 0x800A00AE

[Visual Basic] &H800A00AE

174

The profile-property '%0' is marked as a hashing key, but is not of type 'STRING'.
ERR_INVALID_UNIQUEKEY

[C++] 0x800A00AF

[Visual Basic] &H800A00AF

175

The profile-property '%0' is marked as a unique, primary, and/or join key, but is not of type 'STRING' or 'NUMBER'.
ERR_INVALIDMAP

[C++] 0x800A00B3

[Visual Basic] &H800A00B3

179

The profile property '%0' is mapped to a data member in a source which is not referenced by the join key.
ERR_DUPLICATEJOINMAP

[C++] 0x800A00B4

[Visual Basic] &H800A00B4

180

The join key '%0' references more than one data member from a single source. A join key may map to only one member from a data object.
ERR_KEY_MULTIVALUE

[C++] 0x800A00BB

[Visual Basic] &H800A00BB

187

The property '%0' cannot be multi-valued because it is a key.
ERR_OLEDB_MULTIVAL

[C++] 0x800A00BC

[Visual Basic] &H800A00BC

188

The property '%0' cannot be marked as multi-valued. It references a data member from an OLEDB-ANSI source of type '%1'. Only members of type 'STRING' may be marked as multi-valued.
ERR_VALUE_TOO_LONG

[C++] 0x800A00B8

[Visual Basic] &H800A00B8

184

The database field '%0' cannot be updated. The value '%1' exceeds the maximum length of %2 characters.
ERR_CACHEDPROP_IS_PRIMARYKEY

[C++] 0x800A00B5

[Visual Basic] &H800A00B5

181

The primary key for this profile may not be a cached (non-persistent) property.
ERR_CACHEDPROP_IS_JOINKEY

[C++] 0x800A00B6

[Visual Basic] &H800A00B6

182

The join key for this profile may not be a cached (non-persistent) property.
ERR_MULTIPLE_RDNATTRS

[C++] 0x800A008D

[Visual Basic] &H800A008D

141

The profile '%0' contains multiple properties marked as the RDN Attribute for the data source '%1'. Exactly one RDN Attribute must be defined for each LDAPv3-compliant data source.
ERR_MULTIPLE_HASHKEYS

[C++] 0x800A008E

[Visual Basic] &H800A008E

142

The profile '%0' contains multiple properties marked as the hashing key.
ERR_INVALID_RDNATTR

[C++] 0x800A008F

[Visual Basic] &H800A008F

143

The profile-property '%0' is marked as an RDN-attribute, but does not map to an LDAPv3-compliant data-source.
ERR_PROP_INVALID_HASHKEY

[C++] 0x800A0090

[Visual Basic] &H800A0090

144

The profile-property '%0' is marked as a hashing-key, but does not map to any partitioned data-sources.
ERR_NO_RDN_ATTRIBUTE

[C++] 0x800A0091

[Visual Basic] &H800A0091

145

The profile '%0' uses an LDAPv3-compliant data-source, but no property is marked as the RDN-attribute. Exactly one RDN Attribute must be defined for each LDAPv3-compliant data source.
ERR_INVALID_DATATYPE

[C++] 0x800A00C0

[Visual Basic] &H800A00C0

192

The property: [%0] in profile: [%1] is mapped to an incorrect data type.
ERR_INVALID_MARKEDTYPEREF

[C++] 0x800A00C1

[Visual Basic] &H800A00C1

193

The property: [%0] in profile: [%1] is incorrectly marked as a reference type.
ERR_INVALID_MULTI

[C++] 0x800A00C2

[Visual Basic] &H800A00C2

194

The property: [%0] in profile: [%1] is incorrectly marked as multivalued.
ERR_INVALID_TYPEREF

[C++] 0x800A00C3

[Visual Basic] &H800A00C3

195

The property: [%0] in profile: [%1] is referencing an invalid type.
ERR_INVALID_PROPTYPE

[C++] 0x800A00C4

[Visual Basic] &H800A00C4

196

The property: [%0] in profile: [%1] is of incorrect type.
ERR_INVALID_MAPPEDDATA

[C++] 0x800A00C5

[Visual Basic] &H800A00C5

197

The property: [%0] in profile: [%1] is mapped to a data member: [%2] but this data member does not exist.
ERR_INVALID_MAPPEDDATATYPE

[C++] 0x800A00C6

[Visual Basic] &H800A00C6

198

The property: [%0] in profile: [%1] is mapped to data member: [%2] of incorrect type
ERR_INVALID_PROFILEREF

[C++] 0x800A00C7

[Visual Basic] &H800A00C7

199

The property: [%0] in profile: [%1] is referencing a profile: [%2] that does not exist.
ERR_INVALID_SITETERMREF

[C++] 0x800A00C8

[Visual Basic] &H800A00C8

200

The property: [%0] in profile: [%1] is referencing a siteterm: [%2] that does not exist.

Remarks

You must call the Connect method before calling this method.

The XML data in the parameter sXMLDocument must contain a single profile catalog, and it must conform to the schema in the file MSCSProfileSchema.xml.

If the catalog you want to import was exported without credentials you will need to add credentials for each data source in the catalog before it can be imported.

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

[Visual Basic]

Example

The following example imports a catalog from the file ProfileCatalog.xml:

sConnstr = "Provider=SQLOLEDB;Persist Security Info=False;User ID=user;Password=xxxx;Initial Catalog=Test_commerce;Data Source=w2k;" 

Set oBizDataAdmin = CreateObject("Commerce.BusinessDataAdmin2") 

oBizDataAdmin.Connect(sConnstr) 

oBizDataAdmin.ExportCatalogs "c:\Profile.xml",False 

Dim xmlDoc 

Set xmlDoc = CreateObject("MSXML2.DOMDocument.3.0") 

xmlDoc.load "c:\Profile.xml" 

oBizDataAdmin.ImportCatalogs xmlDoc.xml 

Ee825009.note(en-US,CS.20).gifNote

For the last line of this code sample, the following will not work: oBizDataAdmin.ImportCAtalogs "c:\Profile.xml"

See Also

[C++]BusinessDataAdmin2 Object

[Visual Basic]BusinessDataAdmin2 Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.