Advantage Client Engine
Associates an index file with a database table in the data dictionary.
UNSIGNED32 AdsDDAddIndexFile( ADSHANDLE hAdminConn,
UNSIGNED8 *pucTableName,
UNSIGNED8 *pucIndexFilePath,
UNSIGNED8 *pucComment );
hAdminConn (I) |
Handle of a database connection. |
pucTableName (I) |
Name of the table to associate the index file. |
pucIndexFilePath (I) |
File path of the index file. If the path given is not a fully qualified path, the index file is assumed to be in the same directory as the table. Once the index file is successfully added in the data dictionary and associated with the table, the base filename of the index file including the extension can be used to identify the index file in the data dictionary. |
pucComment (I) |
Optional description of the index file to store in the data dictionary. This parameter can be NULL. |
AE_INVALID_OBJECT_NAME |
The table specified by pucTableName cannot be located in the data dictionary. |
AE_INDEX_ALREADY_OPEN |
The index files is already associated with the specified table. |
AdsDDAddIndexFile associates the specified index file with a database table. After calling this function, all index orders in the specified index file will be automatically available for the table when the table is opened.
ALTER permissions on the associated table are required to add an index to a data dictionary. See Advantage Data Dictionary User Permissions for more information.
Note AdsDDAddIndexFile requires an exclusive open of the table. An error will be returned if the table cannot be opened exclusively.
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.
After making a connection to the database,, add a DBF table into the data dictionary and associate three NTX index files with it (two in the AdsDDAddTable API and one in the AdsDDAddIndexFile API).
AdsConnect60( "n:\\MyData\\myData.ADD", ADS_REMOTE_SERVER, "ADSSYS", NULL, ADS_DEFAULT, &hDD );
AdsDDAddTable( hDD, "Customer Information", "n:\\mydata\\customer.dbf", ADS_NTX,
ADS_ANSI, "Lastname.ntx;Cust_id.ntx", NULL );
AdsDDAddIndexFile( hDD, "Customer Information", "InvoiceDate.ntx", NULL );
AdsDisconnect( hDD );