SQL LITE -3 DATABASE LINKING WITH QT CREATOR
My Qt C++ project involves SQLite databases.
I have to link SQLite-3 database with qt creator as a dynamic library.
to store my data in the database.
currently, I have given a static path ex. (/home/pi/Desktop/database.db) to the database, but I want to give a dynamic ex. (:/datbase.db) path to my database.db so
please help me regarding the dynamic path linking of SQLite lite database with qt creator.
You can use
to find a good location to have it stored.
I have added my database.db file in qt creator resources and copy the path by right click on database .db.
I tried to open the database but database not open error is showing
Help me regarding this ?..
You cannot use Sqllite db when in a res file as its read only.
You will need to use qstandardpaths + QFile::copy and copy it to
writable location and then open it.
in a res fil
is ther any other way to add database in dynamic path
what is wrong with standardpaths ?