I create a QSqlDatabase object an then I open it.
db.open();
QSqlDatabase db;
db=QSqlDatabase::addDatabase("qwe.db");
db.open();
To copy to clipboard, switch view to plain text mode
after that isOpen() and isValid() return true.
After that when I want to connect database I wote this:
if(!db.isOpen()) -->returns false. but I never close db until app closing
{
db.open(); -->it returns false
}
if(!db.isOpen()) -->returns false. but I never close db until app closing
{
db.open(); -->it returns false
}
To copy to clipboard, switch view to plain text mode
after that isOpen() and isValid() return false;
But my queries work and I can get data from database.
What is wrong here?
Bookmarks