Results 1 to 11 of 11

Thread: [QT4][SQLITE] Database and query

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [QT4][SQLITE] Database and query

    Hello !

    I'm trying to have a very little db. My knowledges in db are poor but I just want to know how can I set a minimal db i.e. :
    Qt Code:
    1. MAIN_TREE
    2. entry1
    3. ...(1->L)
    4. entryL
    5. SUB_TREE1
    6. entry1
    7. ...(1->I)
    8. entryI
    9. SUB_TREE...(1->N)
    10. entry1
    11. ...(1->J)
    12. entryJ
    13. SUB_TREEN
    14. entry1
    15. ...(1->K)
    16. entryK
    To copy to clipboard, switch view to plain text mode 

    The entries will just be a list of files (and their path).

    I'm really noob because my very little code doesn't work :

    .h file:
    Qt Code:
    1. QSqlQuery *query;
    To copy to clipboard, switch view to plain text mode 
    .cpp file:
    Qt Code:
    1. [post edit :] query = new QSqlQuery(db);
    2. bool tst = query->exec("CREATE TABLE person");
    To copy to clipboard, switch view to plain text mode 

    => lol. I have a segfault... edit : The segfault is gone but... there isn't any table in the file which is correctly created. The result of the query is "false". But I wonder why... it seems to be a basic query...
    Last edited by agent007se; 2nd July 2006 at 07:53.

Similar Threads

  1. Issues regarding QMySql drivers and mysql database
    By bera82 in forum Qt Programming
    Replies: 2
    Last Post: 10th August 2006, 17:50
  2. Filling combobox from database
    By Philip_Anselmo in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2006, 17:53
  3. Replies: 8
    Last Post: 7th March 2006, 13:40

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.