Results 1 to 9 of 9

Thread: SQL query does not work every time

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: SQL query does not work every time

    The database may fail to open if the killed process did not release a lock on the sqlite file. Are you also using QSqlDatabase::removeDatabase()?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 284 Times in 279 Posts

    Default Re: SQL query does not work every time

    Carefully read the description of the QSqlDatabase::addDatabase method. You have to use the second parameter.

  3. #3
    Join Date
    Sep 2012
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: SQL query does not work every time

    Thanks, I was not using the connection name parameter (neither QSqlDatabase::removeDatabase()) so each time client contacted again it tried to use the same default connection and it failed. Now I'm using clients username to differentiate the database connection name. Seems to work.

    Cheers guys!

Similar Threads

  1. Replies: 2
    Last Post: 16th October 2011, 07:53
  2. setValue of ScrollBar Don't work at first time
    By sergio87 in forum Qt Programming
    Replies: 8
    Last Post: 8th June 2011, 10:00
  3. Replies: 6
    Last Post: 18th August 2010, 12:52
  4. Replies: 0
    Last Post: 12th August 2010, 16:05

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
  •  
Qt is a trademark of The Qt Company.