In my work I have to retouch a utility of many years programmed in vb6 ... all very well, except that I had forgotten the listview control, which only orders by strings. I have searched and tried many functions ... I could not find one that works, or I have not succeeded. The data are records resulting from a SQL query SQL to an Oracle database .. which I already received ordered by the ORDER BY. When loading the data to my Listview (Lvdatos), I tried to convert to string and add 0 to the left ... The idea is that I'm reporting a ranking and that the highest number is up and the ranking descending. Part of the code that loads the Listview:
For b1 = 1 To a1
DoEvents
lblCount.Caption = b1
PB1.value = b1
Carga_Datos (Trim(RsListado!SLOT))
Set subelemento = LvDatos.ListItems.Add(, CStr(b1) & "M", CStr(b1))
subelemento.SubItems(1) = CStr(RsListado!SLOT)
subelemento.SubItems(2) = dato_area
subelemento.SubItems(3) = dato_isla
subelemento.SubItems(4) = dato_juego
If Trim(RsListado!MOTIVO) > 0 Then
subelemento.SubItems(5) = Trae_Motivo(RsListado!MOTIVO)
Else
subelemento.SubItems(5) = "No ingresado"
End If
canti_cad = CStr(RsListado!CANTIDAD)
If Len(canti_cad) = 2 Then canti_cad = "0" & canti_cad
If Len(canti_cad) = 1 Then canti_cad = "00" & canti_cad
subelemento.SubItems(6) = canti_cad
This did not work for me, could someone throw me some idea? Thanks!