Results 1 to 3 of 3

Thread: database open returns false

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    4
    Thanked 4 Times in 4 Posts

    Default database open returns false

    I create a QSqlDatabase object an then I open it.

    Qt Code:
    1. db=QSqlDatabase::addDatabase("qwe.db");
    2. db.open();
    To copy to clipboard, switch view to plain text mode 

    after that isOpen() and isValid() return true.

    After that when I want to connect database I wote this:

    Qt Code:
    1. if(!db.isOpen()) -->returns false. but I never close db until app closing
    2. {
    3. db.open(); -->it returns false
    4. }
    To copy to clipboard, switch view to plain text mode 

    after that isOpen() and isValid() return false;
    But my queries work and I can get data from database.

    What is wrong here?
    Last edited by ahmetturan; 21st January 2014 at 12:32.

Similar Threads

  1. qpixmap.save() returns false
    By Charvi in forum Qt Programming
    Replies: 3
    Last Post: 2nd July 2012, 07:10
  2. QSqlQueryModel insertColumn() returns false
    By kasper360 in forum Newbie
    Replies: 2
    Last Post: 28th March 2011, 04:58
  3. QSslSocke::supportSsl() returns false
    By oscar in forum Qt Programming
    Replies: 1
    Last Post: 9th September 2008, 18:51
  4. QSqlQuery::isValid returns false
    By mismael85 in forum Qt Programming
    Replies: 24
    Last Post: 7th September 2008, 23:43
  5. connect returns false
    By krivenok in forum Qt Programming
    Replies: 6
    Last Post: 21st February 2006, 20:01

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.