2 Replies Latest reply on Aug 23, 2011 4:59 PM by "Andrei Costache, Oracle-Oracle"

    Why I cann't read content for a database ?

      I copy a database from other place,and open it successfully, but I cann't read content by using cursor;In addition,I can write to it ,then,I can read the content that I write only;I am sure that it is not empty,because I can dump the content accoss the command db4.8_dump.The followng is the main code:
      u_int32_t env_flags = DB_CREATE
           | DB_INIT_LOCK
           | DB_INIT_LOG
                | DB_INIT_MPOOL
                | DB_INIT_TXN
           | DB_RECOVER
      | DB_THREAD;
      std::string envHome("/home/bruce/Desktop/dbobject0/");
      u_int32_t db_flags = DB_AUTO_COMMIT
           | DB_CREATE
           | DB_THREAD;
      std::string dbName("test.db");
      DbEnv* myEnv = NULL;
      Db* myDb = NULL;
      myEnv= new DbEnv(0);
      myEnv -> set_cachesize(0,1*1024*1024,0);
      myDb = new Db(myEnv,0);
      Dbt key, value;
      int res = cursorp->get(&key, &value, DB_FIRST);

      every time the res == NOTFOUND