Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User problemsolved's Avatar
    Join Date
    Apr 2011
    Posts
    3
    Hi,

    I am having a problem with SQLITE.

    Code:
    if (QSqlDatabase::isDriverAvailable("QSQLITE"))      // this works fine, returns true
           {
               db = QSqlDatabase::addDatabase("QSQLITE");   //but this statement does not work
               QMessageBox::information(0, tr("Test "), "It works!");    // never reached this statement 
           }
    When the program executes the addDatabase, the simulator hangs then crashes. It always exit with the code -1073741819.

    I have included Qt += sql in pro file and included the whole QtSql package in my file. I am using Qt 4.7.3

    How do I go about this?

    Thank you very much

  2. #2
    Registered User problemsolved's Avatar
    Join Date
    Apr 2011
    Posts
    3
    I am sure that the program enters the if statement. I have run some tests that verified that QSqlDatabase::isDriverAvailable("QSQLITE") returns true

  3. #3
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    That's apparently a Windows access violation. Does the object "db" exist? How is it declared?

  4. #4
    Registered User problemsolved's Avatar
    Join Date
    Apr 2011
    Posts
    3
    You are right. "db" was not initialized properly. Thanks!

Similar Threads

  1. SQLite database and QML
    By angusr in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-03-29, 16:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved