cevou
2nd October 2009, 18:18
Hi folks,
I have a weird problem with SQLite in Qt.
First, here is my code:
QSqlQuery query;
query.prepare("INSERT INTO details (parentid,value) VALUES(?,?)");
query.bindValue(0,parenid);
query.bindValue(1,value);
query.exec();
Sometimes this query doesn't save the entry in the database. The value is then available for an SELECT Statement while the program is running but if I close the program and start it again the value isn't there anymore. I'm not using a memory database and other statements are saved in the DB. The weird thing ist, that sometimes the query saves the entry and sometimes it doesn't.
So does anybody know how to solve this?
I have a weird problem with SQLite in Qt.
First, here is my code:
QSqlQuery query;
query.prepare("INSERT INTO details (parentid,value) VALUES(?,?)");
query.bindValue(0,parenid);
query.bindValue(1,value);
query.exec();
Sometimes this query doesn't save the entry in the database. The value is then available for an SELECT Statement while the program is running but if I close the program and start it again the value isn't there anymore. I'm not using a memory database and other statements are saved in the DB. The weird thing ist, that sometimes the query saves the entry and sometimes it doesn't.
So does anybody know how to solve this?