Results 1 to 16 of 16

Thread: Need help on QSQLITE

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need help on QSQLITE

    Quote Originally Posted by lam-ang View Post
    Hi, I tried it and unfortunately it does nos compile...
    What is the error?
    Probably you have to add some include in your source. Perhaps
    Qt Code:
    1. #include <QtSql/QSqlError>
    To copy to clipboard, switch view to plain text mode 
    A camel can go 14 days without drink,
    I can't!!!

  2. #2
    Join Date
    Oct 2010
    Location
    India
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Need help on QSQLITE

    Hi

    It seems you can run execute your application successfully. But DB is empty/volatile if you restart your qt application. am I right?

    if yes,

    Try this

    Qt Code:

    database->setDatabaseName("memory.db");

    and use CREATE TABLE command rather than CREATE TABLE IF NOT EXISTS Contacts.

    Thanks,
    Vishnu

  3. The following user says thank you to vishnu for this useful post:

    lam-ang (13th June 2011)

  4. #3
    Join Date
    Jul 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: Need help on QSQLITE [SOLVED]

    Hello there,
    Thanks for helping me out, I appreciate it very much...its running fine now.
    I hope it is okay if I have another question, how can I use another database like Mysql if my target is a pc..any idea or link?

    thanks and regards,
    lam-ang
    Last edited by lam-ang; 13th June 2011 at 16:20.

  5. #4
    Join Date
    Oct 2010
    Location
    India
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Need help on QSQLITE [SOLVED]

    Hello,

    IF you want to know about the SQL support drivers,

    use the following debug code,
    Qt Code:
    1. debugLog("Driver supports name "<<db.drivers());
    To copy to clipboard, switch view to plain text mode 
    you can get the list supporting drivers name.

    I think PC will support the following the drivers ("QSQLITE", "QPSQL7", "QPSQL") by default

Similar Threads

  1. QSqlite issues
    By duave in forum Newbie
    Replies: 2
    Last Post: 3rd April 2011, 23:32
  2. QSqlite changes between 4.3 and 4.7
    By LKIM in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2011, 19:50
  3. qsqlite for winCE
    By giginjose in forum Newbie
    Replies: 0
    Last Post: 27th July 2010, 15:54
  4. QSQlite driver
    By praveen_g in forum Newbie
    Replies: 6
    Last Post: 18th November 2009, 08:58
  5. QSqlite in QT4
    By sophister in forum Qt Programming
    Replies: 26
    Last Post: 5th April 2009, 12:52

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.