Results 1 to 6 of 6

Thread: MS SQL QODBC Query Size -1

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: MS SQL QODBC Query Size -1

    Sorry i think if Szie() is -1 then next() and value() will by not work. Thx for help.
    Is other way to check how meny record have query ???

    I do someting like that, it work's but is not good way.
    Qt Code:
    1. void MainWindow::on_pushButtonGetUsers_clicked()
    2. {
    3.  
    4.  
    5. QSqlQuery query(db);
    6. query.exec("SELECT Knt_Kod, Knt_Ulica, Knt_NrDomu, Knt_Miasto, Knt_KodPocztowy, Knt_Poczta, Knt_Pesel FROM CDN.Kontrahenci");
    7. query.next();
    8. if(!query.value(0).toString().isEmpty())
    9. {
    10. ui->tableWidget->setRowCount(1);
    11. addRecordToTable(&query, 0);
    12. query.next();
    13.  
    14. int row=2;
    15. while(!query.value(0).toString().isEmpty())
    16. {
    17. ui->tableWidget->setRowCount(row);
    18. addRecordToTable(&query, row-1);
    19. row++;
    20. query.next();
    21. }
    22. }
    23. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Pablik; 30th March 2017 at 08:25.

Similar Threads

  1. Replies: 7
    Last Post: 16th April 2015, 17:11
  2. Replies: 2
    Last Post: 13th October 2014, 18:35
  3. SSL with QODBC ??!
    By codeman in forum Qt Programming
    Replies: 0
    Last Post: 21st September 2010, 09:01
  4. QODBC has feaure (Query Size)
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2009, 03:29
  5. Query Size needed
    By baray98 in forum Qt Programming
    Replies: 5
    Last Post: 18th July 2009, 08:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.