Beginner need help -
03-18-2006
, 03:16 AM
Hi,
When I want to put a record into my database which has been created
and opened in an environment with below code, It returns an "Invalid
argument"error, error number: 22.
code: (omit some...)
/**create env **/
……………………
penv->open(penv, "/root/db_ccurnt", DB_CREATE|DB_INIT_MPOOL, 0);
db_create(&usr, penv, 0);
usr->open(usr, NULL, "database", NULL, DB_BTREE, DB_CREATE,
0666);
usr->cursor(usr, NULL, &wcursor, 0);
key.data = xx;
key.size = strlen(xx) + 1;
value.data = yy;
value.size = strlen(yy) + 1;
ret = wcursor->c_put(wcursor, &key, &value, DB_KEYFIRST);
if (ret)
{
printf("error num: %d%s\n", ret, db_strerror(ret));
goto error;
}
Will anybody shed some shine for me?Thanks! |