Advantage Client Engine
Sets one property associated with a specified index key in the data dictionary.
UNSIGNED32 AdsDDSetIndexProperty( ADSHANDLE hDBConn,
UNSIGNED8 *pucTableName,
UNSIGNED8 *pucIndexName,
UNSIGNED16 usPropertyID,
VOID *pvProperty,
UNSIGNED16 usPropertyLen );
hDBConn (I) |
Handle of a database connection. |
pucTableName (I) |
Name of the table on which the index has been built. |
pucIndexName (I) |
Name of the index object to set the associated property. |
usPropertyID (I) |
Index of an Index property to set. See Remarks for allowed values. |
pvProperty (I) |
Pointer to the buffer where the property value is stored. |
usPropertyLen (I) |
The size of the property specified by the pvProperty. |
AE_INVALID_OBJECT_NAME |
Possible cause for the error is that the pucTableName or pucIndexName does not refer a valid object in the database. |
AE_INVALID_PROPERTY_ID |
Either the value supplied in usPropertyID is not a valid property ID for an index, or the specified property cannot be set. |
AdsDDSetIndexProperty sets one property associated with the specified index. The new property overwrites the existing property in the data dictionary. The following are the valid values of usPropertyID and the expected value in pvProperty and usPropertyLen.
ALTER permission on the table containing the index is required to modify data dictionary index properties. See Advantage Data Dictionary User Permissions for more information.
Note This function can be called inside a transaction, but will not be part of the transaction. Any changes it makes cannot be rolled back.
usPropertyID |
Description |
ADS_DD_COMMENT |
Stores a new description for the index. The pvProperty parameter is expected to be a NULL terminated string. usPropertyLen is the length of the string including the NULL terminator. If pvProperty is NULL or an empty string, the index description is removed. |
After making a connection to the database, set a new index description for the index "Field1" in table "Table1".
AdsConnect60( "n:\\MyData\\myData.ADD", ADS_REMOTE_SERVER, "ADSSYS", NULL, ADS_DEFAULT, &hDD );
sprintf( aucDesc, "This is an index description" );
ulReturnCode = AdsDDSetIndexProperty( hDD, "Table1", "Field1", ADS_DD_COMMENT, aucDesc,
(UNSIGNED16)( strlen(aucDesc) + 1 ));
See Also