Code sample: create alphabet from database SQL column(s)

Merlot2309

Active Member
Licensed User
Longtime User
Hello,

Hope this is helpful for at least someone.
I wanted an alphabetic list in my app and this is the code result

B4X:
Dim substr As String

crABC = ST.ExecQuery("SELECT distinct substr(" & languages & ",1,1), " & languages & " FROM [tablename] GROUP BY substr(" & languages & ",1,1)")   
lvABC.Clear

   For i = 1 To crABC.RowCount -1
   crABC.Position = i
      lvABC.AddSingleLine(crABC.GetString2(0))
   Next

   crABC.Close

This code also resolved my problems with special characters, like É and Я

Helen.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…