Could it be possible to have two different connections to handle two different databases?
-
wrote on 11 Jan 2011, 06:33 last edited by
Hi, Sir:
I use QSqliteDatabase to addDatabse for two different files, however, it always show me "driver not loaded".
Could anyone teach me how to have two databases simultaneously?PS: I don't use "attach" way because I need to handle them as two different connections.
Thanks a lot.
BR,
Pico -
wrote on 11 Jan 2011, 09:24 last edited by
Let me get this straight: you have no problems using a single SQLite database connection, but you can not make a second one work?
-
wrote on 11 Jan 2011, 11:20 last edited by
You can call addDatabase() twice; just be sure to give different connection names in the two calls. In subsequent calls to QSqlDatabase::database() put the name of the desired connection to the argument list.
For your errors: Show us some code please, we cannot guess what you are doing.
-
wrote on 11 Jan 2011, 13:22 last edited by
Hi, All:
Thanks a lot. I just follow your recommendation, and it works now.Thanks again...
1/4