Results 1 to 6 of 6

Thread: SQLite truble

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    Some where in Argentina
    Posts
    23
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy SQLite truble

    I've got problems with this code:

    Qt Code:
    1. QSqlQuery *cola = new QSqlQuery("SELECT id, pregunta, respuesta, referencia, dificultad, tema FROM preguntas");
    2. if( cola->exec() )
    3. {
    4. while( cola->next() )
    5. {
    6. cout<<"-----------------------------------------------"<<endl;
    7. cout<<"Numero de pregunta: "<<cola->value(0).toInt()<<endl;
    8. cout<<"Tema:" <<cola->value(5).toInt()<<endl;
    9. cout<<"Dificultad:" <<cola->value(4).toInt()<<endl;
    10. cout<<"Texto: " <<cola->value(1).toString()<<endl;
    11. cout<<"Respuesta:" <<cola->value(2).toString()<<endl;
    12. cout<<"Referencia:" <<cola->value(3).toString()<<endl;
    13. }
    14. delete(cola);
    15. return;
    16. }
    To copy to clipboard, switch view to plain text mode 

    When run it, it's stops al the first .toString() output. If the last 3 outputs are not there the cycle work fine... Any Idea????...
    Using Qt 3 with linux
    Thanks
    Last edited by jacek; 16th August 2006 at 02:16. Reason: added code tags

Similar Threads

  1. Qt with SQLite help please
    By munna in forum Newbie
    Replies: 6
    Last Post: 11th July 2006, 14:12

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.