Sub update_detail(id As String)
Dim Data As List
DateTime.DateFormat = "dd-MMM-yy, HH:mm"
Data.Initialize
' Dim rs As ResultSet = sql_gear.ExecQuery("SELECT gear_moves.qr_code, gear_moves.state, gear_moves.date, gear_moves.who, gear_moves.note, gear_moves.sync, gear_items.size FROM gear_items INNER JOIN gear_moves ON gear_items.qr_code = gear_moves.qr_code WHERE ((gear_items.type)='" & id & "');")' ORDER BY id DESC")
' Dim rs As ResultSet = sql_gear.ExecQuery("SELECT GM.qr_code, GM.state, GM.date, GM.who, GM.note, GM.sync, GI.size FROM gear_items GI INNER JOIN gear_moves GM ON GI.qr_code = GM.qr_code WHERE ((GI.type)='" & id & "');")' ORDER BY id DESC")
Dim rs As ResultSet = sql_gear.ExecQuery2("SELECT GM.qr_code, GM.state, GM.date, GM.who, GM.note, GM.sync, GI.size FROM gear_items GI INNER JOIN gear_moves GM ON GI.qr_code = GM.qr_code WHERE GI.type= ? ", Array As String( id))
Log("row count: " & rs.RowCount)
If rs.RowCount > 0 Then
Do While rs.NextRow
Dim row(4) As Object
If id = "BCD" Or id = "Wetsuit" Then
row(0) = rs.GetString("gear_items.size")
Else
row(0) = "-"
End If
row(1) = rs.GetString("gear_moves.state")
row(2) = DateTime.Date(rs.GetString("gear_moves.date"))
row(3) = rs.GetString("gear_moves.who")
Data.Add(row)
Loop
rs.Close
details_tbl.SetData(Data)
Else
' If details_tbl.Size > 0 Then details_tbl.ClearDataView
Log("table size: " & details_tbl.Size)
details_tbl.refresh
End If
End Sub
Private Sub Button1_Click
details_tbl.Clear
details_Column(0) = details_tbl.AddColumn("DETAILS", details_tbl.COLUMN_TYPE_TEXT)
details_Column(1) = details_tbl.AddColumn("STATUS", details_tbl.COLUMN_TYPE_TEXT)
details_Column(2) = details_tbl.AddColumn("DATE", details_tbl.COLUMN_TYPE_TEXT)
details_Column(3) = details_tbl.AddColumn("WHO", details_tbl.COLUMN_TYPE_TEXT)
details_Column(0).Width = 20%x
details_Column(1).Width = 18%x
details_Column(2).Width = 20%x
details_Column(2).Width = 25%x
update_detail("Reg")
End Sub