[Solved] Could anyone tell me if it's possible to apply QSqlDatabase to handle an Android sqlite file?
-
wrote on 14 Dec 2010, 14:38 last edited by
Hi, All:
Recently, I want to show data in Android sqlite file on a GUI application based on QT.
However, I failed to use QSqlDatabase to get the total tables in file.
It always says only "1" table in file, and, if I use another non-free software to see the file, I get 17 tables.
So, I guess something wrong here.Is it possible to handle a database file retrieved from Android phone in a QT-based application?
Thanks a lot.
BR,
Pico -
wrote on 14 Dec 2010, 14:40 last edited by
Welcome pico, remember that Qt in not QT (quicktime).
-
wrote on 14 Dec 2010, 14:45 last edited by
Are you using this function?
"QSqlDatabase::tables":http://doc.qt.nokia.com/stable/qsqldatabase.html#tablesthis return a QStringList.
[quote author="pico" date="1292337516"]Hi, All:
Recently, I want to show data in Android sqlite file on a GUI application based on QT.
However, I failed to use QSqlDatabase to get the total tables in file.
It always says only "1" table in file, and, if I use another non-free software to see the file, I get 17 tables.
So, I guess something wrong here.Is it possible to handle a database file retrieved from Android phone in a QT-based application?
Thanks a lot.
BR,
Pico[/quote] -
wrote on 14 Dec 2010, 14:46 last edited by
It should be working . Qt SQLite plugin is based on sqlite.org.
-
wrote on 15 Dec 2010, 02:52 last edited by
Hi, Stuk:
Thanks, I will always use Qt from now on.Yes, I use QSqlDatabase::tables to get QStringList.
But, I use QStringList.::size() to check its number, I only get 1 instead of 17.
Could you please tell me what I could do? -
wrote on 15 Dec 2010, 07:54 last edited by
This is very strange are you try with a different sqlite with many tables?
Sqlite is sqlite everywhere.[quote author="pico" date="1292381524"]Hi, Stuk:
Thanks, I will always use Qt from now on.Yes, I use QSqlDatabase::tables to get QStringList.
But, I use QStringList.::size() to check its number, I only get 1 instead of 17.
Could you please tell me what I could do?
[/quote] -
wrote on 15 Dec 2010, 09:33 last edited by
Hi, Stuk:
I don't try other sqlite with many tables. I also try to open this file with SQliteman, but, it fails.
Only "SQlite Expert Professional 3" could open it with correct table lists now.
Do I need to update Qt to v4.7?Thanks
-
wrote on 15 Dec 2010, 09:42 last edited by
Mmm, try open this file "link":http://jump.fm/FDAXP
it have 3 tables.[quote author="pico" date="1292405590"]Hi, Stuk:
I don't try other sqlite with many tables. I also try to open this file with SQliteman, but, it fails.
Only "SQlite Expert Professional 3" could open it with correct table lists now.
Do I need to update Qt to v4.7?Thanks
[/quote]
-
wrote on 15 Dec 2010, 10:21 last edited by
[quote author="pico" date="1292405590"]Do I need to update Qt to v4.7?[/quote]
Upgrading to the latest stable version is usually a good idea, yes. -
wrote on 15 Dec 2010, 14:07 last edited by
Hi, All:
After upgrading to v4.7, the return result is OK.
Thanks a lot.BR,
-
wrote on 15 Dec 2010, 14:33 last edited by
Great !
2/11