PDA

View Full Version : Deploying sqlite app



codeman
9th October 2009, 14:40
Hello friends,

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



Unable to establish a database connection.
This Example needs SQLite support. Please read the Qt SQL driver documentation for information how to build it.


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 :



qApp->addLibraryPath("..\\sqldrivers");


So what goes wrong here???

I install the default sdk with the installer 2009.04....

codeman
9th October 2009, 16:47
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



QString apppath;
apppath.append("/sqldrivers");
apppath = QCoreApplication::applicationDirPath();
qApp->addLibraryPath(apppath);


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???

codeman
9th October 2009, 19:50
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.

codeman
15th October 2009, 00:16
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 ????!!!!

Lykurg
16th October 2009, 10:12
There is no clean explanation on the docu I think ????!!!!

Well there is a quite good one! Start here (http://doc.trolltech.com/4.5/deployment.html) and continue reading here: http://doc.trolltech.com/4.5/deployment-windows.html (Note the section Qt Plugins)

codeman
16th October 2009, 15:10
Ok....
I have read it.

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




[Paths]
Prefix =
Documentation =
Headers =
Libraries =
Binaries =
Plugins = plugins
Data =
Translations=
Settings =
Examples =
Demos =

In the aplications dir I create a plugins folder with two subfolder imagesformats and sqldrivers and fullfill it from

C:\Qt\2009.04\qt\plugins

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.???

codeman
20th October 2009, 14:09
Do I install some mssql specific software to run my app succesfully at the other machnine with no qt sdk???

codeman
21st October 2009, 11:13
Ok I solve it.