AdsDDGetUserGroupProperty

Advantage Client Engine

Retrieves one property associated with a database user group from the data dictionary into the supplied buffer.

Syntax

UNSIGNED32 AdsDDGetUserGroupProperty( ADSHANDLE hDBConn,

UNSIGNED8 *pucUserGroupName,

UNSIGNED16 usPropertyID,

VOID *pvProperty,

UNSIGNED16 *pusPropertyLen );

Parameters

hDBConn (I)

Handle of a database connection.

pucUserGroupName (I)

Name of the database user group object to retrieve the associated property.

usPropertyID (I)

Index of a database user group property to retrieve. See Remarks for allowed values.

pvProperty (O)

Pointer to the buffer where the property is to be copied into.

*pusPropertyLen (I/O)

On input, it specifies the size of the buffer pointed to by pvProperty. On output, it returns the length of property stored in the buffer.

Special Return Codes

AE_INVALID_OBJECT_NAME

Possible cause for the error is that the pucUserGroupName does not specify a valid user group in the database.

AE_INVALID_PROPERTY_ID

Either the value supplied in usPropertyID is not a valid database user group property ID, or the specified property is not retrievable.

AE_INSUFFICIENT_BUFFER

The size of the property to be copied into pvProperty is larger than the buffer size specified by *pusPropertyLen. The required buffer length is returned in *pusPropertyLen when this error occurs.

AE_PROPERTY_NOT_SET

The requested property is not set in the data dictionary. No data is returned in pvProperty and *pusPropertylen.

Remarks

AdsDDGetUserGroupProperty retrieves one property associated with the specified user group. User group properties are only available to users that belong to the specified group or to users with ALTER permissions for the group. See Advantage Data Dictionary User Permissions for more information. When connected as the administrator (ADSSYS user account), properties from any user group can be retrieved. The following are the valid values of usPropertyID and the expected return value in pvProperty and *pusPropertyLen.

usPropertyID

Description

ADS_DD_COMMENT

Returns the description of the user group in pvProperty.

ADS_DD_USER_DEFINED_PROP

Returns the user defined property for the specified user group.

Example

After making a connection to the database, retrieve a list of tables that the user group "Managers" has any access rights to.

AdsConnect60( "n:\\MyData\\myData.ADD", ADS_REMOTE_SERVER, "ADSSYS", NULL, ADS_DEFAULT, &hDD );

usLen = sizeof( aucTableRights );

ulReturnCode = AdsDDGetUserGroupProperty( hDD, "Managers", ADS_DD_TABLE_RIGHTS,

aucTableRights, &usLen );

See Also

AdsDDCreateUserGroup

AdsDDSetUserGroupProperty

AdsDDAddUserToGroup

AdsDDRemoveUserFromGroup

AdsDDGetUserProperty

AdsDDGrantPermission

AdsDDRevokePermission

system.usergroups