[Qt-interest] mqsql query terminating at 100th result

Al a_kirk at hughes.net
Mon Feb 1 01:18:02 CET 2010


Hello,
just to check, you aren't connected to a 'demo database engine' that 
returns a maximum of 100 elements in a query?
Al

Robert Wood wrote:
> Andreas Unger wrote:
>  > 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
>  >
>
> Hi Andreas,
>
> Hopefully I understand the question correctly (I've put the code in 
> below again for clarity):
>
> I am calling that routine when a button is pressed. A combo box has 
> selected the particular table name, so if I set a breakpoint at the line:
>
> pos = query.at();
>
> I hit that line 99 times, the variable "line" counts up to 99 (pos is 
> actually at 98). If I then single step through the code I hit the 
> while(query.next()) code and it drops out of the while loop.
>
> The breakpoint is set before I start the program, so the while loop ,ust 
> be only called once.
>
> Cheers,
>
> Rob
>
>
>         queryString = "SELECT * FROM " + ui->tablesComboBox->currentText();
>         query.exec(queryString);
>         rows = query.size();
>
>         line = 0;
>         while(query.next())
>                 {
>                 pos = query.at();
>                 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++;
>                 }
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>   



More information about the Qt-interest-old mailing list