Qt-interest Archive, March 2007
sqlite problem "library routine called out of sequence"
Message 1 in thread
Can you help me. I don't know why i get error: "library routine called
out of sequence" from sqlite driver. This my code:
#include <QtGui>
#include <QtSql>
#include "TForm.h"
TForm::TForm()
{
setupUi(this);
db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"));
db.setDatabaseName("test.db3");
QSqlQuery query;
if (db.open())
{
if (!query.exec("create table images (locationid int, file
varchar(20))"))
{
qDebug(qPrintable(query.lastError().text()));
}
}
--
[ signature omitted ]
Message 2 in thread
Ok, i found problem, strange what query not global for child blocks O.o
This work fine:
if (db.open())
{
QSqlQuery query;
if (!query.exec("create table images (locationid int, file
varchar(20))"))
{
qDebug(qPrintable(query.lastError().text()));
}
SABROG пишет:
> Can you help me. I don't know why i get error: "library routine called
> out of sequence" from sqlite driver. This my code:
>
> #include <QtGui>
> #include <QtSql>
> #include "TForm.h"
>
> TForm::TForm()
> {
> setupUi(this);
> db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"));
> db.setDatabaseName("test.db3");
> QSqlQuery query;
> if (db.open())
> {
> if (!query.exec("create table images (locationid int, file
> varchar(20))"))
> {
> qDebug(qPrintable(query.lastError().text()));
> }
> }
--
[ signature omitted ]