From this thread :
https://b4x.com/android/forum/threa...custom-navigation-buttons.102362/#post-642555
I add Sub to load data from cursor.
These are the steps :
1) Open file B4XTable.b4xlib with 7Zip (or Winrar/Winzip)
2) Modify file B4XTable.Bas, add this code
Sample of use
https://b4x.com/android/forum/threa...custom-navigation-buttons.102362/#post-642555
I add Sub to load data from cursor.
These are the steps :
1) Open file B4XTable.b4xlib with 7Zip (or Winrar/Winzip)
2) Modify file B4XTable.Bas, add this code
B4X:
Public Sub SetDataFromCursor (Data As Cursor)
If sql1.IsInitialized Then sql1.Close
#if B4J
sql1.InitializeSQLite("", ":memory:", True)
#Else If B4A OR B4I
sql1.Initialize("", ":memory:", True)
#End If
CreateTable
Dim sb As StringBuilder
sb.Initialize
sb.Append("INSERT INTO data VALUES (")
For i = 0 To Columns.Size - 1
sb.Append("?,")
Next
sb.Remove(sb.Length - 1, sb.Length)
sb.Append(")")
Private ColVal As List
sql1.BeginTransaction
For x = 0 To Data.RowCount - 1
Data.position = x
ColVal.Initialize
For i = 0 To Columns.Size - 1
ColVal.Add(Data.GetString2(i))
Next
sql1.ExecNonQuery2(sb.ToString, ColVal)
Next
sql1.TransactionSuccessful
CountAll = Data.RowCount
Refresh2 (True)
End Sub
Sample of use
B4X:
Private Cur As Cursor
Private S as SQL
Cur = S.ExecQuery("select * from COUNTY")
B4XTable1.SetDataFromCursor(Cur)