[Qt-interest] QSqlQuery::exec: database not open error
Gigin Jose
gigin_jose at yahoo.co.in
Thu Feb 3 15:22:47 CET 2011
Hi,
I am developing a QT application for my ARM based embedded device. In my application, I am working on two databases, one is the local database on the memory of the device and the other is on a remote MS SQL server desktop. Here is how I initialize both the databases:
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE","local");QSqlDatabase db1 = QSqlDatabase::addDatabase("QODBC","remote");
Both the databases are getting open, which I am checking with db.open. But once I try to execute query for any database, (eg. create table), I am getting the error "QSqlQuery::exec: database not open" If I work with just once database, I am not getting the error and can comfortably execute queries within that database.
Why is this happening ? How can I comfortably work with more than one database in an application ?
With RegardsGIGIN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110203/2fc23aa4/attachment.html
More information about the Qt-interest-old
mailing list