Hello,
I am a "beginner" with some DB experience 25 years ago in VB and thought I try to use B4X to bridge the gap to android tablets for my sheep program, which I try to convert to B4J first. I hope the members excuse the surely stupid simple problem being posted here.
In my recent test I followed the DBUtils for B4J example of Erel (https://www.b4x.com/android/forum/threads/dbutils-example.34611/#content) but use the modern DBUtils Ver. 2.02 (I found out I can't autofill comboboxes). The problem is that both DBUtils.execute... commands only produce the first row of results (of four in my test Sqlite DB, which I can confirm by sql query in DB Browser for SQLite)
Thank you very much for hints and tips to other examples I have missed.
I uploaded breedcenter zip (database) and full test programcode sheepmaster zip
I am a "beginner" with some DB experience 25 years ago in VB and thought I try to use B4X to bridge the gap to android tablets for my sheep program, which I try to convert to B4J first. I hope the members excuse the surely stupid simple problem being posted here.
In my recent test I followed the DBUtils for B4J example of Erel (https://www.b4x.com/android/forum/threads/dbutils-example.34611/#content) but use the modern DBUtils Ver. 2.02 (I found out I can't autofill comboboxes). The problem is that both DBUtils.execute... commands only produce the first row of results (of four in my test Sqlite DB, which I can confirm by sql query in DB Browser for SQLite)
B4X:
#Region Project Attributes
#MainFormWidth: 400
#MainFormHeight: 600
#AdditionalJar: sqlite-jdbc-3.21.0
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private DateOfBirth As Label
Private FatherID As Label
Private Gender As RadioButton
Private bnext As Button
Private TagID As Label
Private bnext As Button
Dim sql1 As SQL
Private TableView1 As TableView
Private ComboBox1 As ComboBox
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("lMain") 'Load the layout file.
MainForm.Show
'
'
sql1.InitializeSQLite(File.DirApp, "files/breedcenter.db", True)
'
Dim lcombo As List
lcombo=DBUtils.Executelist(sql1, "SELECT TagID FROM animalDB", Null, 0)
ComboBox1.Items.AddAll(lcombo)
DBUtils.ExecuteTableView(sql1, "SELECT TagID FROM animalDB", Null, 0, TableView1)
End Sub
Thank you very much for hints and tips to other examples I have missed.
I uploaded breedcenter zip (database) and full test programcode sheepmaster zip
Attachments
Last edited: