×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Angry SQLITE database problem

    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
    Join Date
    Apr 2011
    Posts
    3

    Re: SQLITE database problem

    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
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: SQLITE database problem

    That's apparently a Windows access violation. Does the object "db" exist? How is it declared?

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Re: SQLITE database problem

    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
  •