_BusinessDataAdmin2::ImportCatalogs Method
Use this method to import the profile catalog (profile schema) in an XML document to the business data store.
HRESULT _BusinessDataAdmin2::ImportCatalogs(
BSTR* sXMLDocument
);
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.
[Visual Basic]
A String that contains the XML document containing the profile catalog to be imported.
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 |
---|---|---|
ERR_NOCONNECTION |
0x800A00BF &H800A00BF 191 |
No connection is open to the database. The Connect() method should be called first. |
ERR_XML_PARSE |
0x800A007A &H800A007A 122 |
Parse errors in XML document '%0', line %1, col %2. Reason: %3 |
ERR_BAD_NAMESPACE |
0x800A00CB &H800A00CB 203 |
The XML does not contain the correct namespace. |
ERR_MEMBER_INVALID_NEWDELETE |
0x800A00A2 &H800A00A2 162 |
One or more profile-members have invalid attributes: isNew='1' and isDeleted='1'. |
ERR_MISSING_CATALOG |
0x800A00CD &H800A00CD 205 |
The file does not contain any catalogs. |
ERR_MEMBER_INVALID_NEWMODIFIED |
0x800A00A4 &H800A00A4 164 |
One or more profile-members have invalid attributes: isNew='1' and isModified='1'. |
ERR_INVALID_CATALOG_NAME |
0x800A00CC &H800A00CC 204 |
The catalog '%0' is an invalid name. |
ERR_CATALOG_DELETEFAILED |
0x800A0079 &H800A0079 121 |
Cannot delete catalog '%0'. Source: '%1' Reason: '%2' |
ERR_CATALOG_EXISTS |
0x800A006E &H800A006E 110 |
Catalog '%0' already exists. |
ERR_CATALOG_NOTFOUND |
0x800A0074 &H800A0074 116 |
Cannot find catalog '%0'. |
ERR_SOURCE_INVALIDTYPE |
0x800A00B0 &H800A00B0 176 |
'%0' is not a valid source type. |
ERR_NO_SRCINFOS |
0x800A0087 &H800A0087 135 |
No source-infos were specified for data-source '%0'. |
ERR_TOO_MANY_SRCINFOS |
0x800A0088 &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 |
0x800A0089 &H800A0089 137 |
One source-info must be marked as default for data-source '%0'. |
ERR_TOO_MANY_PARTITIONS |
0x800A00BA &H800A00BA 186 |
The data source '%0' contains %1 partitions. A single data source cannot have more than %2 partitions. |
ERR_SOURCE_INVALIDNAME |
0x800A00A9 &H800A00A9 169 |
The data source '%0' cannot be created because the source name contains invalid characters: %1 |
ERR_DUPLICATE_SOURCENAME |
0x800A00BD &H800A00BD 189 |
A data-source already exists with the name '%0'. |
ERR_SOURCE_EXISTS |
0x800A0066 &H800A0066 102 |
Error: The data-source '%0' already exists and cannot be created or modified. |
ERR_DUPLICATE_PARTITIONNAME |
0x800A00BE &H800A00BE 190 |
A data-source partition already exists with the name '%0'. |
ERR_SRCINFO_SRCTYPE |
0x800A00B3 &H800A00B3 178 |
The source type of data-source '%0' cannot be modified. |
ERR_SRCINFO_NOTFOUND |
0x800A008A &H800A008A 138 |
The source-info '%1' could not be found in data-source '%0'. |
ERR_ATTRIBUTE_INVALIDNAME |
0x800A00A8 &H800A00A8 168 |
The attribute '%0' cannot be created because the attribute name contains invalid characters: %1 |
ERR_ATTRIBUTE_EXISTS |
0x800A0085 &H800A0085 133 |
Duplicate names are not allowed: '%0' already exists on '%1'. |
ERR_TABLE_INVALIDNAME |
0x800A00B1 &H800A00B1 177 |
The data object '%0' cannot be created because the object name contains invalid characters: %1 |
ERR_TABLE_EXISTS |
0x800A0082 &H800A0082 130 |
The data-object '%0' already exists. (Source '%1', Catalog '%2'.) |
ERR_TABLE_NOTFOUND |
0x800A0083 &H800A0083 131 |
The data-object '%0' could not be found. (Source '%1', Catalog '%2'.) |
ERR_COLUMN_EXISTS |
0x800A007F &H800A007F 127 |
The data-member '%0' already exists. |
ERR_COLUMN_NOTFOUND |
0x800A007E &H800A007E 126 |
The data-member '%0' could not be found. |
ERR_INVALID_TYPEDEF |
0x800A0078 &H800A0078 120 |
The data type '%1' for source member '%0' is invalid. |
ERR_INVALID_TYPEDEF_FOR_SOURCE |
0x800A00B7 &H800A00B7 183 |
The data type '%1' for source member '%0' is invalid (data type invalid for source type '%2'). |
ERR_MEMBER_EXISTS |
0x800A0077 &H800A0077 119 |
Profile-member '%1' cannot be created. A property or group named '%0' already exists within the profile. |
ERR_MEMBER_NOTFOUND |
0x800A0081 &H800A0081 129 |
The profile-member '%0' could not be found. |
ERR_MEMBER_NOT_GROUP |
0x800A007D &H800A007D 125 |
The profile-member corresponding to group '%0' in the XML document is not a group. |
ERR_PRIMARYKEY |
0x800A00AB &H800A00AB 171 |
Profile '%0' could not be created/updated because it does not have exactly one primary key defined. |
ERR_JOINKEY |
0x800A00AC &H800A00AC 172 |
Profile '%0' could not be created/updated because it does not have exactly one join key defined. |
ERR_INVALIDTYPE_RDNATTR |
0x800A00AD &H800A00AD 173 |
The profile-property '%0' is marked as an RDN-attribute, but is not of type 'STRING'. |
ERR_INVALID_HASHKEY |
0x800A00AE &H800A00AE 174 |
The profile-property '%0' is marked as a hashing key, but is not of type 'STRING'. |
ERR_INVALID_UNIQUEKEY |
0x800A00AF &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 |
0x800A00B3 &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 |
0x800A00B4 &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 |
0x800A00BB &H800A00BB 187 |
The property '%0' cannot be multi-valued because it is a key. |
ERR_OLEDB_MULTIVAL |
0x800A00BC &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 |
0x800A00B8 &H800A00B8 184 |
The database field '%0' cannot be updated. The value '%1' exceeds the maximum length of %2 characters. |
ERR_CACHEDPROP_IS_PRIMARYKEY |
0x800A00B5 &H800A00B5 181 |
The primary key for this profile may not be a cached (non-persistent) property. |
ERR_CACHEDPROP_IS_JOINKEY |
0x800A00B6 &H800A00B6 182 |
The join key for this profile may not be a cached (non-persistent) property. |
ERR_MULTIPLE_RDNATTRS |
0x800A008D &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 |
0x800A008E &H800A008E 142 |
The profile '%0' contains multiple properties marked as the hashing key. |
ERR_INVALID_RDNATTR |
0x800A008F &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 |
0x800A0090 &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 |
0x800A0091 &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 |
0x800A00C0 &H800A00C0 192 |
The property: [%0] in profile: [%1] is mapped to an incorrect data type. |
ERR_INVALID_MARKEDTYPEREF |
0x800A00C1 &H800A00C1 193 |
The property: [%0] in profile: [%1] is incorrectly marked as a reference type. |
ERR_INVALID_MULTI |
0x800A00C2 &H800A00C2 194 |
The property: [%0] in profile: [%1] is incorrectly marked as multivalued. |
ERR_INVALID_TYPEREF |
0x800A00C3 &H800A00C3 195 |
The property: [%0] in profile: [%1] is referencing an invalid type. |
ERR_INVALID_PROPTYPE |
0x800A00C4 &H800A00C4 196 |
The property: [%0] in profile: [%1] is of incorrect type. |
ERR_INVALID_MAPPEDDATA |
0x800A00C5 &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 |
0x800A00C6 &H800A00C6 198 |
The property: [%0] in profile: [%1] is mapped to data member: [%2] of incorrect type |
ERR_INVALID_PROFILEREF |
0x800A00C7 &H800A00C7 199 |
The property: [%0] in profile: [%1] is referencing a profile: [%2] that does not exist. |
ERR_INVALID_SITETERMREF |
0x800A00C8 &H800A00C8 200 |
The property: [%0] in profile: [%1] is referencing a siteterm: [%2] that does not exist. |
Remarks
You must call the __BusinessDataAdmin2::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.
Example
The following example imports a catalog from the file ProfileCatalog.xml:
Dim xd As New XmlDocument()
xd.Load("C:\myFolder\ProfileCatalog.xml")
Dim sXml As String = xd.OuterXml
BusinessDataAdmin2.ImportCatalogs(sXml)