SQLITE Database in Project
-
[quote author="vsh.vshnu" date="1305635099"]Hi Volker,
Its simply
QString dbName="test.sqlite";Iam developing for meego in windows developement enviorment using Qt creator[/quote]
Try to use the absolute path. You can get the file path of the application executable using "QCoreApplication::applicationFilePath":http://doc.qt.nokia.com/latest/qcoreapplication.html#applicationFilePath
Cheers,
Leon -
[quote author="leon.anavi" date="1305635864"]
[quote author="vsh.vshnu" date="1305635099"]Hi Volker,
Its simply
QString dbName="test.sqlite";Iam developing for meego in windows developement enviorment using Qt creator[/quote]
Try to use the absolute path. You can get the file path of the application executable using "QCoreApplication::applicationFilePath":http://doc.qt.nokia.com/latest/qcoreapplication.html#applicationFilePath
Cheers,
Leon[/quote]
Hi Leon,
Thanks for the support ,
I have tried using the QCoreApplication::applicationFilePath
@QString dbName=QCoreApplication::applicationFilePath()+“\test.sqlite”;@
But it seems not opening the database.
All I wanted to pack the sqlite database inside my application so that i can install the applications as a single unit. -
[quote author="Volker" date="1305635745"]Do you have a test.sqlite that actually is packed in your setup?
[/quote][quote author="vsh.vshnu" date="1305636668"]
All I wanted to pack the sqlite database inside my application so that i can install the applications as a single unit.
[/quote]I think you should follow Volker's hint :) Please read "MeeGo Packaging/Guidelines":http://wiki.meego.com/Packaging/Guidelines As you probably know MeeGo apps are distributed as rpm so you have to include your database into the rpm.
-
[quote author="leon.anavi" date="1305637109"][quote author="Volker" date="1305635745"]Do you have a test.sqlite that actually is packed in your setup?
[/quote][quote author="vsh.vshnu" date="1305636668"]
All I wanted to pack the sqlite database inside my application so that i can install the applications as a single unit.
[/quote]I think you should follow Volker's hint :) Please read "MeeGo Packaging/Guidelines":http://wiki.meego.com/Packaging/Guidelines As you probably know MeeGo apps are distributed as rpm so you have to include your database into the rpm.
[/quote]
Thanks for the help.. i will look into it..
Thanks & Regards,
Vsh.Vshnu -
@goetz
some time , we need store a read-only database file in the QRC file. just need read no need change.
store in qrc file will avoid use change ,delete....etc it. and use database file (qsqlite3 ) will be fast get query result.now qt version is 5.8. can we do it ?
best regards,
-
@cawlfj
Well its not impossible to still dig it out using a hex editor.
For dbs, something like
https://www.zetetic.net/sqlcipher/about/
might be better.
Maybe you can use the dump trick to upload to a :mem based db.
http://stackoverflow.com/questions/3826552/in-python-how-can-i-load-a-sqlite-db-completely-to-memory-before-connecting-to
Disclaimer: i never tried this.