[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What happened to gb.db2?


Le 27/04/2025 à 16:58, Jorge Carrión a écrit :
In gb.db, resultFields is an Array[] of resultFields objects. You can obtain the name of a field with MyResult.Fields[n].Name. In gb.db2 resultFields is a collection with the Field.Name as key and the resultfield object as value. You can obtain the name of a field with MyResult.fields["name"], for example.

I have a lot of controls and routines who work with resultfields.names and this is a little annoying.

What I've done is a little function who discriminate what version is actually running:

Public Function Fieldnames(r As Result) As String[]

Dim $cFields As New String[]
   Dim n As Integer

   If Object.Class(r).Component.Name = "gb.db2" Then
     Dim skey As ResultField
     For Each skey In r.Fields
       $cFields.Add(skey.Name)
     Next
   Else
     For n = 0 To r.Fields.Count - 1
       $cFields.Add(r.Fields[n].Name)
     Next
   Endif
   Return $cFields

End

and implemented it on my projects. I didn't know if it was a bug, so I didn't report it.

'gb.db2' is supposed to have the same interface as 'gb.db' as much as possible.

It's 'gb.db' redone now written in Gambas, with the drivers partly rewritten in Gambas, so that only the minimum is written in C. Easier to debug and fix!

So don't hesitate to report any difference, I will see what I can do to fix it if possible.

Regards,

--
Benoît Minisini.


References:
What happened to gb.db2?Jorge Carrión <shordi@xxxxxxxxx>
Re: What happened to gb.db2?Christof Thalhofer <chrisml@xxxxxxxxxxx>
Re: What happened to gb.db2?Jorge Carrión <shordi@xxxxxxxxx>