다음을 통해 공유


_BusinessDataAdmin2::ExportCatalogs Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

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

HRESULT _BusinessDataAdmin2::ExportCatalogs(
  BSTR* sFileName,
  VARIANT_BOOL* bRemoveCredentials
);
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.

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

    [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 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_WRONG_PARAM

0x800A0072

&H800A0072

114

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

ERR_PROFILE_NOTFOUND

0x800A0075

&H800A0075

117

Cannot find profile '%0'.

ERR_SOURCE_NOTFOUND

0x800A0071

&H800A0071

113

Cannot find data-source '%0' in catalog '%1'.

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

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

Example

The following example exports the profile catalog to a file:

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

See Also

Other Resources

BusinessDataAdmin2 Object