[Gambas-user] Show records on a WebTable

herberth guzman herberthguzman at ...626...
Tue Mar 21 19:06:16 CET 2017


>Le 17/03/2017 à 20:18, Tobias Boege a écrit :
> I didn't test it, but the following is approximately how it goes:
>
>   Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As WebTableData)
>     Dim i As Integer
>     Dim f As ResultField
>
>     cx = M_DB.Connect()
>     rs = cx.Exec("SELECT * FROM tbcategory")
>
>     ' Go to the Row-th record in your result
>     For i = 0 To Row - 1
>       rs.MoveNext
>     Next

>--> Please use rs.MoveTo(I) instead. :-)

>--
>Benoît Minisini


Tobias - Benoit thanks for your help, it has been useful.
My webtable works fine.


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

  Dim i As Integer
  Dim f As Resultfield

  cx = M_DB.Connect()
  rs = cx.Exec("SELECT Title FROM tbapps where tbapps.Title like  '%'")

  For i = 0 To Row - 1
    rs.MoveTo(i)
  Next

  If rs.Available Then
    i = rs.Fields.Count
    For Each f In rs.Fields
      If i = Column Then Break
      Inc i
    Next
    Data.Text = rs[f.Name]
  Endif

End

Herberth



More information about the User mailing list