ICatalogManager3::SetPropertyAttributes Method [C++]

Use this method to change the value of attributes of properties.

Definition

[C++]

HRESULT ICatalogManager3::SetPropertyAttributes(_Recordset*pRSNewState,
  VARIANTfForceUpdate);

[Visual Basic]

Sub SetPropertyAttributes(pRSNewState As Recordset,
  Optional fForceUpdate As Variant)

Parameters

  • pRSNewState[C++]
    [in] A reference to a _Recordset object that specifies the new attribute values.
  • pRSNewState[Visual Basic]
    A Recordset object that specifies the new attribute values.
  • fForceUpdate[C++]
    [in, optional] A VARIANT that specifies whether to force an update.
  • fForceUpdate[Visual Basic]
    A Variant that specifies whether to force an update.

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.

Name Value Description
E_CAT_CATMGR_NOT_INITIALIZED

[C++] 0x889800B

[Visual Basic] &H8898005

The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method.
E_INVALIDARG

[C++] 0x8007005

[Visual Basic] &H8007007

One or more arguments are invalid.
E_CAT_INVALID_RECORDSET

[C++] 0x889800A

[Visual Basic] &H889800E

The recordset you specified is either invalid or empty.
E_CAT_PROP_DOESNT_EXIST

[C++] 0x8898000

[Visual Basic] &H8898005

The property name you specified does not exist.
E_CAT_CANNOTCHANGE_DATATYPE

[C++] 0x8898010

[Visual Basic] &H889801E

The datatype of this property cannot be changed.
E_CAT_INVALID_LANG_ATTRIBUTE

[C++] 0x889800F

[Visual Basic] &H8898002

The Languagesensitive attribute of this property cannot be changed because this property is being used in one or more catalogs.
E_CAT_INVALID_ISFREETEXTSEARCHABLE_ATTRIBUTE

[C++] 0x8898003

[Visual Basic] &H889800A

The attribute IsFreeTextSearchable can be set to only String, FilePath, and Enumeration datatypes.
E_CAT_INVALID_COLUMN_LENGTH

[C++] 0x8898004

[Visual Basic] &H8898000

The length specified for this property does not lie between 1 and 4000.
E_CAT_PROP_DOESNT_EXIST

[C++] 0x8898000

[Visual Basic] &H8898005

The property name you specified does not exist.
E_CAT_INVALID_PROPERTY_LENGTH

[C++] 0x8898005

[Visual Basic] &H8898007

The property you specified is being used as a ProductID or VariantID. You cannot decrease the maximum length of this property or change its data type.

[C++] Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

Use a Recordset object returned from either the GetPropertyAttributes method or the CreateProperty method as the pRSNewState parameter so that its time stamp can be compared with the time stamp of the existing property for error detection. You can change all attributes for a property except its data type and language-sensitive attribute. The only exception is that you can change a String data type to a Text data type.

You cannot change the LanguageSensitive attribute of a property. However, you can convert non-multilingual properties to multilingual properties by using the Commerce Server 2002 upgrade tool, located in /Program Files/Microsoft Commerce Server 2002/Upgrade/CS2002Upgrade.exe.

Property attribute names, and therefore the *strAttrName*****parameter, are limited to a maximum length of 36 characters, and cannot contain any of the following characters:

  • Comma (,)
  • Double quote (")
  • Left square bracket ([)
  • Right square bracket (])

Attribute values of type String are limited to a length of 4000 characters.

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 changes the datatype of MyProperty to Text.
'The existing DataType attribute of MyProperty must equal cscString.

Set Rs = oCatalogManager.GetPropertyAttributes(“MyProperty”)
Rs(“DataType”) = cscText 
oCatalogManager.SetPropertyAttributes rs

See Also

[C++]CatalogManager Object

[Visual Basic]CatalogManager Object

[C++]ICatalogManager3::CreateProperty

[Visual Basic]CatalogManager.CreateProperty

[C++]ICatalogManager3::GetPropertyAttributes

[Visual Basic]CatalogManager.GetPropertyAttributes

Copyright © 2005 Microsoft Corporation.
All rights reserved.