
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
I managed to solve the problem, but I am not sure why. When I add
(*dbp)->set_cachesize(), before opening the database(s), I no longer
get the application error. Even if I set the cache to 0 (default cache
size).
Does anyone have any suggestions why?
Thanks
Eric
extern int open_single_database(DB_ENV *dbenv, DB **dbp, int
allowdups, char *dbname, char *dbloc)
{
int ret;
if ((*dbp) !=NULL)
{
return -4;
}
if ((ret = db_create(&(*dbp), dbenv, 0)) != 0)
{
return ret;
}
// This has to be here, I was getting errors on some databases
without it.
if( ret = (*dbp)->set_cachesize((*dbp),0,0,0) !=0)
{
return ret;
}
if(allowdups == 1)
{
if ((ret = (*dbp)->set_flags((*dbp), DB_DUP | DB_DUPSORT)) != 0)
{
return ret;
}
}
if ((ret = (*dbp)->open((*dbp), NULL, dbloc, dbname,
DB_BTREE,DB_RDONLY, 0)) != 0)
{
return ret;
}
return 0;
}
[EMAIL PROTECTED] (Derick Smith) wrote in message news:<[EMAIL PROTECTED]>...
> Can anyone offer any suggestions:
>
> I am compiling a program with the libdb41sd.lib (debug) libdb41s.lib
> (release) libraries.
>
> I have made a few working (debug and release) programs with these
> libraries already. I am getting an 'Applicaton Error' [The instruction
> at "ox0040244e" referenced memory at "0x00c26000". The memory could
> not be "read"] with the release version for one program only.
>
> This program reads a BerkeleyDB and dumps the database contents to
> several text files. (There are multiple databases within a single
> file).
>
> It only happens with 2 of my Berkeley database files, other databases
> appear to work. I have tried recreating the databases and I get the
> exact same error at the same location for the given database. The
> error occurs at different locations in the two databases. It is
> frusterating because it does not happen in the debug version.
>
> Can anyone give me any suggestions?
>
> Thanks
> Eric
| <-- __Chronological__ --> | <-- __Thread__ --> |