igoreshka3333
22nd August 2015, 16:24
Hi, how can I may to locate a data base in my project? I did the following. I adding a database witch situated on another disk in some folder:
m_mydb = QSqlDatabase::addDatabase( "QSQLITE" );
m_mydb.setDatabaseName( ":D/DB/EmployeeInfo.sqlite" );
But I want to locate it in the project folder. I have tried to add my data base to the project as a resource, first i have add a prefics /, in the project folder add a folder 'DB', in the qt appear a prefix '/' and a resource file DB/EmployeeInfo.sqlite
I have telling a path:
m_mydb.setDatabaseName( ":/DB/EmployeeInfo.sqlite" );
but it doesn't work, can you promt me?
Thanks.
m_mydb = QSqlDatabase::addDatabase( "QSQLITE" );
m_mydb.setDatabaseName( ":D/DB/EmployeeInfo.sqlite" );
But I want to locate it in the project folder. I have tried to add my data base to the project as a resource, first i have add a prefics /, in the project folder add a folder 'DB', in the qt appear a prefix '/' and a resource file DB/EmployeeInfo.sqlite
I have telling a path:
m_mydb.setDatabaseName( ":/DB/EmployeeInfo.sqlite" );
but it doesn't work, can you promt me?
Thanks.