MDAC 2.5 SDK - Technical Articles


 

ITrusteeAdmin::SetTrusteeProperties

Sets properties for the trustee, such as the display name or authentication information.

HRESULT SetTrusteeProperties ( 
   TRUSTEE *   pTrustee,
   ULONG       cPropertySets,
   DBPROPSET   rgPropertySets[]
);

Parameters

pTrustee

[in]
Address of an initialized TRUSTEE structure that identifies the trustee whose properties are to be retrieved.

cPropertySets

[in]
Number of DBPROPSET structures in rgPropertySets. If this is zero, the provider ignores rgPropertySets and the method returns S_OK without doing anything.

rgPropertySets

[in, out]
Array of DBPROPSET structures describing properties to be set on the trustee.

The property IDs specified in this structure must belong to the Trustee property group.

If cPropertySets is zero, rgPropertySets is ignored.

Return Code

S_OK

The properties for the trustee were successfully set.

DB_S_ERRORSOCCURRED

One or more of the properties could be set, but some could not be set. Properties not in error remain set. The consumer checks dwStatus in the DBPROP structures to determine which properties were not set and why.

DB_E_ERRORSOCCURRED

No properties were set. The consumer checks dwStatus in the DBPROP structures to determine why properties were not set.

SEC_E_PERMISSIONDENIED

Requester does not have permissions for the operation.

SEC_E_BADTRUSTEEID

pTrustee did not point to a valid TRUSTEE structure.

SEC_E_NOTRUSTEEID

pTrustee was not a trustee for the current data source object.

E_INVALIDARG

pTrustee was a null pointer; or cPropertySets was not zero and rgPropertySets was a null pointer; or, in a DBPROPSET structure in the array rgPropertySets, cProperties was not zero and rgProperties was a null pointer.

E_FAIL

A provider-specific error occurred.

Comments

If the same property is specified more than once in rgPropertySets, it is provider-specific which value is used.

The DBPROPSTATUS enumerated type in the OLE DB Programmer's Reference lists the possible status values returned in the dwStatus element of the DBPROP structures.

See Also

DBPROPSTATUS, ITrusteeAdmin, ITrusteeAdmin::GetTrusteeProperties, Properties Overview, TRUSTEE, Trustee property group