Results 1 to 15 of 15

Thread: Sqlite data base

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Symbian S60

    Default Re: Sqlite data base

    sir ,
    Again not execute Query ,and not show any error
    if you have possible please help with small source code.
    Thanks

  2. #2
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Sqlite data base

    Though Qt in general is perfectly happy with forward slashes for path separators, SQLite is not. One should use QDir::toNativeSeparators to convert a forward-slashed path to backslashes.

    Quote Originally Posted by sabbu View Post
    sir ,
    Again not execute Query ,and not show any error
    if you have possible please help with small source code.
    Thanks
    What do you mean "not execute Query"?? How do you know it did not execute??

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

    Default Re: Sqlite data base

    Here are some tips:
    • Use [code][/code] tags around code. Your persistence in ignoring this politely requested courtesy to readers is wearing very thin with this reader.
    • Using an sqlite command line tool connect to the same database and execute the query manually. If it doesn't work here then it certainly won't work from your code.
    • Read the QSqlQuery and QSqlError docs.
    • Do not ignore the return value from QSqlQuery::exec()
    • If the QSqlQuery::exec() call fails then do something with the QSqlQuery::lastError() and you will be very much wiser.


    If your database looks like the one you are defining here then the problem is that you have no table called City. Follow the advice above and you will know precisely inside a minute.

    While you are at it, have a look at all the bits of advice you have received on this same program fragment: here, here, and here
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  4. #4
    Join Date
    Apr 2011
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Symbian S60

    Default Re: Sqlite data base

    thanks
    my query executed

Similar Threads

  1. Update changes in QTableView to sqlite data base
    By nagabathula in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2011, 01:18
  2. Sqlite data base
    By sabbu in forum Newbie
    Replies: 2
    Last Post: 19th May 2011, 23:43
  3. Sqlite data base
    By sabbu in forum Qt Programming
    Replies: 5
    Last Post: 19th May 2011, 11:57
  4. Replies: 4
    Last Post: 19th December 2010, 06:15
  5. program for working with Data Base(i need it)
    By banakil in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2007, 22:58

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.