Open DB from local URL
-
hi, I have a problem, I have to read and connect from local DB "mydb.db" SQLite so i create the connection:
@ilMeteoDB = QSqlDatabase::addDatabase("QSQLITE","MYDB");
ilMeteoDB.setDatabaseName(QCoreApplication::applicationDirPath() + "/mydb.db");@with this method I can create the connection and i can use "mydb.db" because the path of file is correct [the path is inside my project] but this method work only whit simulator because the path to application.exe is correct.
but when i try to launch the application on device (Nokia - N8) the path that the method "applicationDirPath()" return is not correct to generate the db connection. I have read that isn't necessary the path from Embedded url but if i delete the method the result is the same. in particular the program generate a connection but if i return, for example, the name of the table of my db return only 1 table call "sqlite_master" or somthing like this and i can't interact whit my DB.
now my answer is: how can i call my DB file correctly to generate the exaclty connection?
sorry for my bad english and tnx if someone can help me.
-
Have a look at "this bug report":http://bugreports.qt.nokia.com/browse/QTBUG-18944