Results 1 to 3 of 3

Thread: error while opening the database from Qt

  1. #1
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default error while opening the database from Qt

    Hi,
    I am trying to open a database and create a table using SQL server 2008, everything is working fine,
    when the application is executed for first time and if I re-run the application once again the same database it is throwing some runtime errors, how to check whether if that database is already opened wit the same name

    I have attached my code please do suggest something.s
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: error while opening the database from Qt

    What are the thrown errors ?
    Normally QSqlDatabase::isOpen() can be used to check if the databse connection is currently open.
    Dont forget to close the connection of course using QSqlDatabase::close().
    You need to be more specific when you seek help.

    Good Luck.

  3. #3
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error while opening the database from Qt

    Thankyou toufic for your reply.. finally got it..

Similar Threads

  1. Problem Opening Sqlite database from Qt
    By ronak.vashi in forum Newbie
    Replies: 2
    Last Post: 29th October 2012, 12:18
  2. Replies: 0
    Last Post: 27th February 2011, 14:39
  3. Replies: 9
    Last Post: 20th May 2010, 09:55
  4. "Error opening framebuffer device"
    By rishiraj in forum Installation and Deployment
    Replies: 8
    Last Post: 1st April 2009, 06:29
  5. submitAll() : database error
    By locus in forum Qt Programming
    Replies: 3
    Last Post: 27th January 2007, 05:49

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.