The iopen_db function is called to open an existing database. It requires a single argument, the name of the database (no extension necessary). The iopen_db function opens two files, the data file with extension DB and the index file with extension IDX. Like the icreate_db function, the iopen_db function returns a pointer to a database object of type Db_Obj. A return value of NULL indicates that an error occurred in attempting to open the existing database.
The following example program opens the existing database named BOOKS. The two database files, BOOKS.DB and BOOKS.IDX, must be present in the current directory for this program to successfully open the database.