Results 1 to 20 of 27

Thread: QSqlite in QT4

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    China
    Posts
    127
    Thanks
    30
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QSqlite in QT4

    I am trying to use QSqlite in my QT project.
    according to the QT assistant, I use the QSqlquery to insert data into database, but failed!!
    Here's my code:
    QSqlQuery insert(db);
    insert.exec("select * from Person");
    int num = insert.size();
    if( !insert.isActive())
    QMessageBox::information(this, "Query not activited", "Sorry but this query is not activited!");
    bool ok = insert.exec( QString("insert into Person values (%1, \'%2\', \'%3\', %4)").arg(num + 1).arg(name).arg(sex).arg(age));

    Plz tell me how to make it if anybody know it.
    Thanks!!
    Last edited by sophister; 3rd April 2009 at 16:25. Reason: This problem has gone, and another comes

Similar Threads

  1. Replies: 1
    Last Post: 7th July 2008, 20:13
  2. QSQLITE | unable to establish connection
    By suresh in forum Newbie
    Replies: 4
    Last Post: 1st July 2008, 11:17
  3. QSQLITE dirver not loaded
    By mismael85 in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd April 2008, 20:07
  4. QSQLITE Questions
    By larry104 in forum Qt Programming
    Replies: 9
    Last Post: 24th April 2007, 23:54
  5. QSQLITE Unable to fetch row in create
    By xgoan in forum Newbie
    Replies: 3
    Last Post: 18th October 2006, 14:39

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.