Results 1 to 4 of 4

Thread: QT + Sqlite not working

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2010
    Posts
    26
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post QT + Sqlite not working

    I need to use sqlite databases with Qt, and data submiting is not working.
    I've connected a button click to this:
    Qt Code:
    1. void submit()
    2. {
    3. if(!model->database().driver()->hasFeature(QSqlDriver::Transactions))
    4. qDebug() << "sqlite driver doesn't support transactions";
    5. if(model->database().transaction())
    6. {
    7. if(model->submitAll())
    8. {
    9. model->query().finish();
    10. if(model->database().commit())
    11. {
    12. model->query().exec();
    13. commitBtn->setEnabled(false);
    14. return;
    15. }
    16. }
    17. }
    18. model->database().rollback();
    19. QMessageBox::information(
    20. this,
    21. tr("Database error"),
    22. model->database().lastError().text());
    23. }
    To copy to clipboard, switch view to plain text mode 
    I've once tried without the query stop stuff but no success, two days since i've started searching around a way but nothing. I hope you guys can help me, thanks in advance, and sorry my bad english.
    Last edited by BrainStorm; 10th August 2010 at 20:52.

Similar Threads

  1. [Qt][SQLite] Two problems with SQLite.
    By Xandareva in forum Newbie
    Replies: 6
    Last Post: 6th April 2010, 23:06
  2. OUT OF MEMORY - Error while working with sqlite
    By Askar in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2009, 23:54
  3. SQLite with Qt4
    By MIH1406 in forum Newbie
    Replies: 6
    Last Post: 15th September 2009, 04:47
  4. SQLite in QT
    By sophister in forum Qt Programming
    Replies: 11
    Last Post: 8th April 2009, 16:09
  5. working with SQLite
    By bhs-ittech in forum Qt Programming
    Replies: 3
    Last Post: 15th September 2008, 07:51

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.