I have been able to write to the databaserepeatedly; several records have
been added to it in a table named ‘name’ tolook like this:
Id - tile -  fname - mname - lname
100 - Mr - Me - Who - Papá
101 - Mrs - She - What - Mamá
102 - Mr - He - Who - Papá
I am now trying to read all the informationfrom the table using the below
strip-down C++ code, but no matter what I try I only get the first row
displayed (row Id = 100), I would like to know how does one tell SQLite3 to
read the subsequent rows using the C/C++ API.
TIA
void mySQLite3::setStmt(const Glib::ustring& s) {
SQLStatement = s;
if (mystmt == NULL) { rc = sqlite3_prepare_v2(db, SQLStatement.c_str(), -1,
&mystmt,NULL); }
if(rc != SQLITE_OK) {...}
rc = sqlite3_step(mystmt);
}
const int mySQLite3::read_int(int pos) {
   if(rc == SQLITE_ROW ) { apint = sqlite3_column_int(mystmt,pos); }
   return apint;
}
const Glib::ustring& mySQLite3::read_str(const int pos) {
   if(rc == SQLITE_ROW ) { apstr = (const
char*)sqlite3_column_text(mystmt,pos); }
   return apstr;
}
-- 
Happiness has many doors, and when one of them closes another opens, yet we
spent so much time looking at the one that just closed that we don't see
the one that just opened..
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to