[Qt-interest] mqsql query terminating at 100th result
Andreas Unger
andi.unger05 at gmail.com
Sun Jan 31 22:56:19 CET 2010
Hello,
Just out of curiosity, does the method which contains the
while(query.next()) loop get called more than once? If so, does this issue
of termination at the 100th entry occur the very first time you go into the
while loop?
Cheers,
Andreas
On Sun, Jan 31, 2010 at 11:58 AM, Robert Wood
<robert.wood at apostrophe.co.uk>wrote:
> Folks,
>
> I am taking some baby steps into knocking up a fairly simply database
> front end. I have a load of tables created in knoda and I can happily
> connect to the database and open and examine all the tables.
>
> However, when the tables are greater than 99 rows, even though the
> query.size() returns the correct number of rows, the query.next() just
> terminates at the 100th entry.
>
> My code is here:
>
> queryString = "SELECT * FROM " + ui->tablesComboBox->currentText();
> query.exec(queryString);
> rows = query.size();
>
> line = 0;
> while(query.next())
> {
> pos = query.at();
> line++;
> ui->tableWidget->insertRow(pos);
> queryString = "";
> for (j=0;j<columns;j++)
> {
> queryString = query.value(j).toString();
> QTableWidgetItem *qTItem = new QTableWidgetItem;
> qTItem->setText(queryString);
> ui->tableWidget->setItem(line,j,qTItem);
> }
> line++;
> }
>
> This fills up my table very nicely in terms of reading all the values in
> all the columns until I hit line 100 where the while (query.next()) loop
> exits. I get pos returning 4,294,967,294 in qt creator, which is -2, the
> result for the end of table I think. What I find odd is that the line:
>
> rows = query.size();
>
> Does give figures much greater than 99 reflecting te real size of the
> table.
>
> Can any one shed any light on this please?
>
> Many thanks!
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100131/1941c88f/attachment.html
More information about the Qt-interest-old
mailing list