Results 1 to 10 of 10

Thread: Unable to work with database

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    203
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    7
    Thanked 4 Times in 3 Posts

    Default Re: Unable to work with database

    I edited the code a litte:
    Qt Code:
    1. qDebug() << "Database sequence " << iDatabaseSequence << "Database name = " << sDatabaseName << "File associated = " << sDatabaseFileName;
    To copy to clipboard, switch view to plain text mode 

    Now it prints out:

    Database sequence 0 Database name = "main" File associated = "D:\path to .db file where the .exe is data.db"

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Unable to work with database

    Your query as posted is not valid SQL and should be returning an error.

    If the query was corrected in the obvious way and returns no rows, i.e. the while() loop is never entered, that would be because there are no rows in that table with 'EMPTY' in column4. This is correct behaviour.

  3. #3
    Join Date
    Jun 2011
    Posts
    203
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    7
    Thanked 4 Times in 3 Posts

    Default Re: Unable to work with database

    Turns out, everything is working fine, I think my database is corrupt (or I stuffed up access to sqlite conversion), if I search for WHERE column4 = 'SOMETHING', it works, and indeed, if I just pull all the data that it can without the where statement, it only pulls the the SOMETHINGs, so not quite sure where the database got corrupted but at least it pretty much solved.

Similar Threads

  1. Replies: 0
    Last Post: 28th June 2013, 11:52
  2. Mysql unknown database, QMYSQL unable to connect
    By lixo1 in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2010, 21:39
  3. Replies: 9
    Last Post: 20th May 2010, 09:55
  4. ODBC Oracle. Unable to connect to database
    By egil in forum Qt Programming
    Replies: 2
    Last Post: 17th October 2008, 13:46
  5. which ide/editor/database work best with qt4?
    By kkool84 in forum Installation and Deployment
    Replies: 17
    Last Post: 24th August 2006, 06:45

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.