D Eloquence Library
The CLOSE Function
The CLOSE funtion terminates access to a database or resets the current record for a data set. The syntax is as follows:
int cc = idb_close(base,dset,mode,status)
The parameters are:
* a pointer to an integer variable that specifies the data set number;
- Identifies the database. This must be the return value from the idb_open call.
- This parameter is ignored if mode is not equal to 3. Identifies the data set to be rewound. Dset is one of the following:
* a pointer to a character array containing up to 16 characters (bytes) that specifies the data set name. The data set name must be terminated with a semicolon, a blank or \0 character if it is less than 16 characters.
- See below.
- A pointer to an array of a least 10 elements used to indicate the success or failure of the function call.
Mode 1. Close database
Terminate access to the database and deallocate resources.
Mode 3. Rewind data set
The current record of the given data set is reset to zero.
Idb_close terminates access to a database or resets current record for a data set. If a program has issued multiple calls to idb_open for the same database, only the access path of the given base parameter is affected.
Idb_close does the following:
- If idb_close is called with mode 1, access to all data sets in the specified database is terminated. Resources allocated for the database are deallocated.
- If idb_close is called with mode 3, the current record for the given data set is reset to zero.
Returns 0 if successful, or an error number if an error was encountered.
If idb_close was successfully executed, the status array will contain the following values:
|5||DB_CLOSE | (open_mode << 12)|
This will rewind CUSTOMER data set.
Eloquence Database Manual - 19 DEC 2002