[Gambas-user] Show records on a WebTable

Fabien Bodard gambas.fr at ...626...
Wed Mar 22 09:13:00 CET 2017


Herberth :

Private $rs as Result
Private $Fields as New String[]

'or somewhere else
Public sub _New()
dim f as ResultField
dim i as integer


 M_DB.Connect()

'DB is the last connected db
  $rs = DB.Exec("SELECT Title FROM tbapps where tbapps.Title like  '%'")


If rs.Available Then
'  Setup Columns count
  TableView1.Columns.Count = rs.Fiels.Count
  'Setup tableHeader
  For each f in rs.Field
     TableView1.Columns[i].Text = f.name
     inc i
  Next
  'Launch table filling
  TableView1.Rows.Count = rs.Count
EndIf

end


Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As
WebTableData)

  $rs.MoveTo(Row)
'Use the Column Text to get the Field name
Data.Text = $rs[Last.Columns[Column].Text]

End




More information about the User mailing list