[Qt-interest] QSqlite Table not showing all rows in app

Robert Wood robert.wood at apostrophe.co.uk
Sat Feb 6 22:50:31 CET 2010


William Lugg wrote:
> In the DB app I'm working on, when I query the model for the row count 
> it claims it only contains 256 rows, though SQLite and a GUI browser I 
> use to look at the DB both verify that there are actually upwards of 
> 3100 rows in the table. What do I need to do in my code to get at the 
> rest of the data?
> 
> The problem is two fold - I need my record counter to report the total 
> number of records and I need to be able to navigate to those records 
> when the user wants to go there.

Not sure how much sqllite differs from mysql, but how are you querying 
the size of the database? Can we have a peek at the relevant line of 
code please?

This works for me in mysql in that it does return the number of rows in 
the table:

QSqlQuery query;
quint32 rows;
QString queryString;

queryString = "SELECT * FROM tablename"
query.exec(queryString);
rows = query.size();



More information about the Qt-interest-old mailing list