Opening an existing Database is very similar to creating a new one. To
open the Database you have to use the API function ups_env_open_db
.
ups_status_t
ups_env_open_db (ups_env_t *env, ups_db_t **db, uint16_t name,
uint32_t flags, ups_parameter_t *parameter);
The parameters are very similar to ups_env_create_db
.
There is one flag which might be useful from time to time:
UPS_READ_ONLY
. This flag opens the Database for read-only access, and
all write modifications (inserting or deleting items) fail with the
error UPS_READ_ONLY
. Other flags are explained in the API reference.
ups_env_open_db
also uses variable length parameter lists, but this
parameter is currently not used, therefore it must be set to NULL.