Android Question Database load into listview how?

schemer

Active Member
Licensed User
Longtime User
Ok, I am a noob at SQLite but managed to create a db. Now even though I have read a lot of stuff I am not sure I found the answer. My db will be "read only" and lots of examples are using the db in the more normal way of adding and deleting records. I will not be adding or deleting records nor will the end user. I also want to be sure I can even use the listview instead of maybe a better choice to load my records and data into. But for starters, how do I load the db and fill the list? I have tried the Dim SQL1 AS SQL etc but I am having trouble reading the data into the listview. What I want to do is be able to click on a list item and in turn access related data from another column to further process.
Thanks in advance,
schemer
 

Mahares

Expert
Licensed User
Longtime User
android.database.sqlite.SQLiteException: no such table: mytable (code 1): , while compiling: SELECT * From 'mytable';
It should be:
B4X:
txt="SELECT * FROM mytable"

If mytable is a variable you use this:
B4X:
Dim mytable as String =schemer"
txt="SELECT * FROM '" & mytable & "'"
 
Upvote 0

schemer

Active Member
Licensed User
Longtime User
It should be:
B4X:
txt="SELECT * FROM mytable"

If mytable is a variable you use this:
B4X:
Dim mytable as String =schemer"
txt="SELECT * FROM '" & mytable & "'"

That didn't work. I even made a new simple db with 2 fields and 1 row of data. It seems I am having multiple problems all of a sudden and need to start over. Like my layout file is loading and older layout even if I modify and save it. I will keep at it till I get it.
Thanks,
schemer
 
Upvote 0

schemer

Active Member
Licensed User
Longtime User
schemer,
it is helpfull to use some tools like SQLite Manager or something like this. There you can open your database and test your SQL statements.
https://code.google.com/p/sqlite-manager/ (just one idea, there are other...) and also helpful is may be http://www.sqlite.org/lang.html if you are stuck in your queries.

stefan

Stefan,
I have SQLite Professional 3 and even though I am not a professional :rolleyes:, I bought it years ago to support the developer. I will test my queries in my SQLite Pro and see what I get. The app seems to run and execute faster now even though I still end up with a blank screen. :)
Thanks,
schemer

p.s. My queries work fine inside of SQLite Professional.
 
Last edited:
Upvote 0
Top