Results 1 to 8 of 8

Thread: Deploying sqlite app

  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Deploying sqlite app

    Hello friends,

    today I try to start an App on a machine without any qtstuff. I get some error like this:

    Qt Code:
    1. Unable to establish a database connection.
    2. This Example needs SQLite support. Please read the Qt SQL driver documentation for information how to build it.
    To copy to clipboard, switch view to plain text mode 

    So I have a tree like this:

    deploy
    |----->bin
    |-------------->app.exe
    |-------------->QtCore4.dll
    |-------------->QtGui4.dll
    |-------------->QtNetwork4.dll
    |-------------->QtSql4.dll
    |-------------->QtXml4.dll
    |-------------->mingwm10.dll
    |----->images
    |----->sqldrivers
    |------------>qsqlite4.dll
    |------------>sqlite3.dll
    in my app I add the line :

    Qt Code:
    1. qApp->addLibraryPath("..\\sqldrivers");
    To copy to clipboard, switch view to plain text mode 

    So what goes wrong here???

    I install the default sdk with the installer 2009.04....
    Last edited by codeman; 9th October 2009 at 15:46.

  2. #2
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Deploying sqlite app

    Ok I change it to

    deploy
    |-----><bin>
    |---------><sqldrivers>
    |--------------------->qsqlite4.dll
    |--------------------->qsqlodbc4.dll
    |--------------------->sqlite3.dll
    |-------------->app.exe
    |-------------->QtCore4.dll
    |-------------->QtGui4.dll
    |-------------->QtNetwork4.dll
    |-------------->QtSql4.dll
    |-------------->QtXml4.dll
    |-------------->mingwm10.dll
    |----->images


    And change the line in my main.cpp to

    Qt Code:
    1. QString apppath;
    2. apppath.append("/sqldrivers");
    3. apppath = QCoreApplication::applicationDirPath();
    4. qApp->addLibraryPath(apppath);
    To copy to clipboard, switch view to plain text mode 

    This time my sqlite connection work fine but I also have an ODBC con to mssql and I get an <Unable to Connect> message

    could anybody help???

  3. #3
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Deploying sqlite app

    No ideas.

    The problems is that I switch over during programming from qt4.5.1(own compilation) to the qt2009.04 sdk. All connections from the programming machine where my qt lib is works fine
    but when I try to run my app on an another machine I get an odbc error. The Sqlite error is solved.

  4. #4
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Deploying sqlite app

    Ok. Perhaps anybody could explain the basic main steps to deploy an app on windows for a windows machine.

    I read the docus and search the forum nothing help.

    I use sqlite database and odbc connections furthermore jpg images. I try to run it on my virtual machine with no qt. And I get an sqlite error and odbc error and my jpg are not displayed.

    There is no clean explanation on the docu I think ????!!!!

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Deploying sqlite app

    Quote Originally Posted by codeman View Post
    There is no clean explanation on the docu I think ????!!!!
    Well there is a quite good one! Start here and continue reading here: http://doc.trolltech.com/4.5/deployment-windows.html (Note the section Qt Plugins)

  6. #6
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Deploying sqlite app

    Ok....
    I have read it.

    I add to the applicationsdir my qt.conf file with this content

    Qt Code:
    1. [Paths]
    2. Prefix =
    3. Documentation =
    4. Headers =
    5. Libraries =
    6. Binaries =
    7. Plugins = plugins
    8. Data =
    9. Translations=
    10. Settings =
    11. Examples =
    12. Demos =
    To copy to clipboard, switch view to plain text mode 

    In the aplications dir I create a plugins folder with two subfolder imagesformats and sqldrivers and fullfill it from
    Qt Code:
    1. C:\Qt\2009.04\qt\plugins
    To copy to clipboard, switch view to plain text mode 

    Now when I try to start my application on the testmachine my sqlitedriver seems to load but the odbc connection to my mssql doesn´t work.???

  7. #7
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Deploying sqlite app

    Do I install some mssql specific software to run my app succesfully at the other machnine with no qt sdk???

  8. #8
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: Deploying sqlite app

    Ok I solve it.

Similar Threads

  1. access SQlite from Qt (Windows & Linux)
    By Qt Coder in forum Qt Programming
    Replies: 13
    Last Post: 22nd July 2009, 11:07
  2. steps to connect to SQLite from Q
    By Qt Coder in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2009, 13:12
  3. Qt SQLite user functions
    By cevou in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2009, 20:43
  4. sqlite version in Qt
    By janus in forum Newbie
    Replies: 4
    Last Post: 5th February 2009, 15:18
  5. SQLite
    By cyberboy in forum Installation and Deployment
    Replies: 1
    Last Post: 15th April 2008, 20:46

Tags for this Thread

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.