ICatalogManager::SetPropertyAttributes
Use this method to change the attributes of a property.
Definition
HRESULT ICatalogManager::SetPropertyAttributes(_Recordset*pRSNewState,VARIANTfForceUpdate);
Parameters
pRSNewState
[in] A reference to a _Recordset object that specifies the new attribute values.
fForceUpdate
[in, optional] A VARIANT that specifies whether or not to force an update.
Return Values
This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
Error Values
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.
The following table shows the custom COM errors that this method can return.
Constant | Value | Description |
E_CAT_PROP_CHANGED | 0x88980006 | The attributes of the property have changed since the property was last read. This error occurs when the sForceUpdate parameter is False, and the attributes were modified after a call to the CreateProperty or GetPropertyAttributes methods. |
E_CAT_PROP_DOESNT_EXIST | 0x88980005 | There was no property with the name you specified. |
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.
Remarks
Use a Recordset object returned from either the GetPropertyAttributes method or the CreateProperty method as the pRSNewState parameter so that its timestamp can be compared with the timestamp of the existing property for error detection. You can change all attributes for a property except its data type.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
See Also
ICatalogManager::CreateProperty