Results 1 to 3 of 3

Thread: Sqlite with release app

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Posts
    28
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Sqlite with release app

    Hello!

    I'm building and testing my release app for windows. My app use sqlite3 as database.

    In my development machine, where Qt sdk is installed and configured, the app recognise the database and all works as well ( i can see, insert, and update my table data in all my forms), but when i copy my app to a pendrive and test it in another machine, only with windows installed, my app do not recognise the database, and my forms do not show the tables data.

    I've already done all kind of test as i known, and i dont known if the problem is with my code, if is needed install the sqlite on machine, or put some dll in my app folder, or another?...

    My connection:
    Qt Code:
    1. QString _DB = QDir::toNativeSeparators(qApp->applicationDirPath()+"/db.db"); // database path
    2.  
    3. QSqlDatabase con = QSqlDatabase::addDatabase("QSQLITE");
    4. con.setDatabaseName(_DB);
    5. con.open();
    6.  
    7. // code example below
    8. QSqlTableModel *model = new QSqlTableModel(this, con);
    9. model->setTable("my_table");
    10. model->setHeaderData(0, Qt::Horizontal, tr("ID"));
    11. model->setHeaderData(1, Qt::Horizontal, tr("Name"));
    12. model->setHeaderData(2, Qt::Horizontal, tr("Phone"));
    13. model->select();
    14. ui->TableView->setModel(model);
    15.  
    16. con.close();
    To copy to clipboard, switch view to plain text mode 

    the app folder structure:

    E:\app
    + platforms (folder with qwindows.dll and qwindowsd.dll)
    - db.db
    - icudt53.dll
    - icuin53.dll
    - icuuc53.dll
    - libgcc_s_dw2-1.dll
    - libstdc++-6.dll
    - libwinpthread-1.dll
    - Qt5Core.dll
    - Qt5Gui.dll
    - Qt5Sql.dll
    - Qt5Sqld.dll
    - Qt5Widgets.dll
    - app.exe
    can someone help me?
    thanks so much!
    Juliano
    Last edited by juliano.gomes; 9th January 2016 at 23:30.

Similar Threads

  1. Need Help with QT and SQLite
    By chetu1984 in forum Newbie
    Replies: 6
    Last Post: 8th March 2011, 23:22
  2. [Qt][SQLite] Two problems with SQLite.
    By Xandareva in forum Newbie
    Replies: 6
    Last Post: 6th April 2010, 23:06
  3. xml + sqlite
    By eleanor in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2009, 17:06
  4. SQLite in QT
    By sophister in forum Qt Programming
    Replies: 11
    Last Post: 8th April 2009, 16:09
  5. Sqlite drivers and the last release
    By cydside in forum Installation and Deployment
    Replies: 0
    Last Post: 5th April 2009, 20:24

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.