_BusinessDataAdmin2::ExportCatalogs Method [C++]

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

Definition

[C++]

HRESULT _BusinessDataAdmin2::ExportCatalogs(BSTR*sFileName,
  VARIANT_BOOL*bRemoveCredentials);

[Visual Basic]

Sub ExportCatalogs(sFileName As String,
  Optional bRemoveCredentials As Boolean)

Parameters

  • sFileName[C++]
    [in, out] A pointer to A BSTR that specifies the file that will contain the exported profile catalog. This is a local file path — it cannot be a URL.
  • sFileName[Visual Basic]
    A String that specifies the file that will contain the exported profile catalog. This is a local file path — it cannot be a URL.
  • bRemoveCredentials[C++]
    [in, optional] A pointer to a VARIANT_BOOL that specifies whether to remove the credentials from the connection strings in the profile catalog. A value of True indicates remove the credentials. A value of False indicates do not remove the credentials. The default value True.
  • bRemoveCredentials[Visual Basic]
    A Boolean that specifies whether to remove the credentials from the connection strings in the profile catalog. A value of True indicates remove the credentials. A value of False indicates do not remove the credentials. The default value is True.

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_WRONG_PARAM

[C++] 0x800A0072

[Visual Basic] &H800A0072

114

Error: Wrong input parameter (check for Empty or Null input parameter)
ERR_PROFILE_NOTFOUND

[C++] 0x800A0075

[Visual Basic] &H800A0075

117

Cannot find profile '%0'.
ERR_SOURCE_NOTFOUND

[C++] 0x800A0071

[Visual Basic] &H800A0071

113

Cannot find data-source '%0' in catalog '%1'.
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 exported XML document will conform to the schema specified in file MSCSProfileSchema.xml, and will contain both site terms and profile definitions.

If the bRemoveCredentials parameter is True, then the credentials (user name and password) will be removed from all connection strings. These credentials will have to be replaced before the catalog can be imported. If the catalog is imported through Commerce Server Manager, the user must enter a user name and password for each data source partition in the catalog. See Exporting Profile Schema for more information.

If the bRemoveCredentials parameter is False, then the credentials will be exported in plain text with the rest of the catalog.

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 exports the profile catalog to a file:

myBusinessDataAdmin2.ExportCatalogs("C:\myfolder\myProfileCatalog.xml",_
   bRemoveCredentials)

See Also

[C++]BusinessDataAdmin2 Object

[Visual Basic]BusinessDataAdmin2 Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.