PDA

View Full Version : Run sqlite application without installing QT



praveen_g
18th December 2009, 05:18
Hi,

I have an application ( currently on Windows ) which interacts with Sqlite database when I save it, now I could run the application without installing QT. But could not get connected to the database when I save it.

I have tried to install Sqlite directly to the Windows system, but that did not help me to get connected.

Is there a way where I can interact with the Sqlite database without installing QT.

regards.

Lykurg
18th December 2009, 07:49
Well, you have to deliver the right libraries/plugins with your application. Then it will work. Look inside your Qt installation path for a folder called something like "sqldrivers" or so. Inside you should find the related lib for SQLite.

praveen_g
18th December 2009, 08:13
I have tried placing the entire " sqldrivers " folder into my application, but it soesn't work out.

Could you guide me on this ?

Lykurg
18th December 2009, 08:39
Just debug if your application finds the right driver by using
qWarning() << QSqlDatabase::drivers();
Normally it should look like:
- Folder with our exe
- plugins
- sqldrivers
But one week ago I also had trouble with it (even using qt.conf). After removing "plugins" and only have a structure like
qWarning() << QSqlDatabase::drivers();
Normally it should look like:
- Folder with our exe
- sqldrivers
it worked for me.

praveen_g
18th December 2009, 09:03
Thanks a ton ...

It worked !

praveen_g
26th December 2009, 09:39
How do I do the same in Linux ?

Tanuki-no Torigava
26th December 2009, 11:20
The same way. Also have a look at your plugin library on system. On my x64 gentoo it looks like that:



ls /usr/lib64/qt4/plugins/sqldrivers/
libqsqlite.so libqsqlmysql.so libqsqlodbc.so libqsqlpsql.so libqsqltds.so

praveen_g
26th December 2009, 11:44
I have tried copying the plugins folder to my project, but still says "Could not connect to the database !!!"

Tanuki-no Torigava
27th December 2009, 22:02
Check the hierarchy of directories. It should resemble the original Qt.

praveen_g
28th December 2009, 10:59
Hi

could not find a solution for this , could you just tell me from where the drivers are being loaded ? If I could get find it I think I would be able to solve the problem.

thanks and regards

praveen_g
30th December 2009, 09:07
How to find out from which path the drivers are being loaded ?

praveen_g
31st December 2009, 06:36
How to find out from which path the drivers are being loaded ?

Its pretty urgent ! can somebody help me out ...

When I run my application through IDE it works pretty fine but when I run the application individually It doesn't ...

Have tried to figure out the path from where the drivers are being loaded ? but I couldn't succeed on this front. Can somebody help me ?

regards

praveen_g
1st January 2010, 06:42
Hi
First of all I WISH U ALL A VERY HAPPY, PROSPEROUS 'N' SUCCESSFULL NEW YEAR AHEAD ...

I could find the path from where the drivers are being loaded. QtDir / lib / libQtSql.so , libQtSql.so.4 , libQtSql.so.4.5 , libQtSql.so.4.5.3. But these are " link to shared library files ". So how do I use these files in my application ? Kindly help me out. I could not even copy them to any device, though I have copied to my application folder the application coudn't find the drivers.

thanks and regards

Tanuki-no Torigava
8th January 2010, 00:54
Try to run something like that (looks like you are Linux/*NIX user):


find /lib* /usr/lib/* -name "libqsqlite.so" -print