PDA

View Full Version : Can't use sqlite if Qt development Framework not installed



wirasto
4th March 2011, 03:37
I don't understand why this code not executed when Qt development Framework not installed.



....
....

extern QSqlDatabase dbFav;

void DB::init() // this is static void
{
QDir dir;
if (!dir.exists(CONF_PATH))
dir.mkpath(CONF_PATH);

//favorite
dbFav=QSqlDatabase::addDatabase("QSQLITE", "favorite");
dbFav.setDatabaseName(QString("%1/favorite.%2").arg(CONF_PATH).arg(DB_SUFFIX));
dbFav.open();
QStringList tablesFav = dbFav.tables();
QSqlQuery queryFav(dbFav);
if (!tablesFav.contains("folder", Qt::CaseInsensitive)) {
queryFav.exec("CREATE TABLE folder ("
"id integer primary key,"
"nama text not null,"
"id_induk int not null,"
"unique(nama, id_induk)"
")");
}
}

ChrisW67
4th March 2011, 04:41
Have you deployed the Qt Sqlite database plugin with your executable? Search this forum... this problem is addressed nearly every day.

wirasto
4th March 2011, 06:04
I know that. But not work .. :(

myapp.exe
plugins/qsqlite4.dll
....
....

Btw, I run on Windows 7

I know that. But not work .. :(

myapp.exe
plugins/qsqlite4.dll
....
....

Btw, I run on Windows 7

ChrisW67
4th March 2011, 06:11
I know that. But not work .. :(

myapp.exe
plugins/qsqlite4.dll
....
....


Yes it does, but you need to put the file in the correct location: http://www.qtcentre.org/threads/37121-Deploying-program-with-plugin-on-different-computer?p=170819#post170819


Btw, I run on Windows 7
Good for you ;)



I know that. But not work .. :(

myapp.exe
plugins/qsqlite4.dll
....
....

Btw, I run on Windows 7

Quite an echo in here.