Load an existing database file with kvaDbCreate
The function kvaDbCreate can be used to both create empty databases and to load pre-existing ones from file. The behaviour depends on whether a filename is provided.
Example. Open an existing database.
status =
kvaDbCreate(db_handle,
"db_name",
"database.dbc");
Example. Passing null instead of a filename on the other hand would have created a new database:
Example. Open a database file and check for errors.
unsigned int buflen = 128;
char* errstr;
char filename[256];
strcpy(filename, "database.dbc");
{
printf("Could not open the file '%s'.\n", filename);
}
{
printf("Could not parse the file '%s'.\n", filename);
errstr = (char*) malloc(buflen * sizeof(char));
{
free(errstr);
errstr = (char*) malloc(buflen*sizeof(char));
}
printf("%s", errstr);
free(errstr);
}