    my_database.cursor(NULL, &amp;cursorp, 0);

    // Assuming an empty database, this first put places
    // "My first string"/"My first data" in the first 
    // position in the database
    int ret = cursorp-&gt;put(&amp;key1, &amp;data1, DB_KEYFIRST); 

    // This put places "A second string"/"My second data" in the
    // the database according to its key sorts against the key 
    // used for the currently existing database record. Most likely
    // this record would appear first in the database.