Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
09-20-2012 08:37 AM
I am referring to the "Quotes" sample app on https://github.com/blackberry/Cascades-Samples/tre
There a SqlDataAccess object is created and execute() is called.
After that QSqlDatabase::addDatabase is called to create a "non default connection".
Do I have to do that as well? Or could i just work with the SqlDataAccess object? If yes, what would be the up/downsides for that?
Solved! Go to Solution.
09-20-2012 10:06 AM
It seems i can answer my question, working with SqlDataAccess seems to work fine, i only had to ensure the creation of the database with QFile.
I can write my values into the database, but i have some problems reading them, as i don't fully comprehend the QVariant return value.
I execute a sql statement that returns "2" (I use SQLite Database browser to test).
QVariant result = sqlDataAccess->execute("SELECT...)
How do i extract the result from the QVariant?
All the samples throw the whole thing into a listview (or use a different mechanism to query the db).
And how would i do it for a more complex result?
09-21-2012 03:06 PM
Should give you the information you require - whole point of QVariant is that you can define it how you want using toInt, toString etc. QVariant can be used to store any type of data using the value/setValue functions.
09-21-2012 03:32 PM
i am aware of than. But the debugger seems to be unable to tell me what is in the object, and when i call toint() on a QVariant that should contain the value '2' i get 0.
My problem is that i don't really know what the return value stored in QVariant is.
09-30-2012 02:48 AM
10-01-2012 03:30 AM