[Gambas-user] result from select can be movefirts from ODBC?
PICCORO McKAY Lenz
mckaygerhard at ...626...
Wed May 17 18:54:06 CEST 2017
tobias, i answered few seconds, yeah the if was in wrong place.. thanks for
the corrections..
and u dont know that ODBC module in gambas does not implement or have same
behaviour of the others like sqlite or mysql..
count does not retunrs nothing, max neither so i must implement my own
count..
seems that mayority gambas develpoers only used mysql? nobody performs on
mayor scalar DBMS ? oracle, sybase, postgresql?
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
2017-05-17 12:32 GMT-04:00 Tobias Boege <taboege at ...626...>:
> On Wed, 17 May 2017, PICCORO McKAY Lenz wrote:
> > i try to filla gridview at demand, so due ODBC limitations i cannot count
> > so inside my bean-like object i count and tehen return properties..
> >
> > the problem goes when i try to move to the fitrs record, i implement the
> > code in wrong way? :
> >
> > Try resulobj = $conexionodbc.Exec(exisqueryrequest)
> >
> > While (resulobj.Available)
> >
> > If resulobj.MoveNext() Then
> > resulhowmany = resulhowmany + 1
> > Else
> > Break
> > Endif
> >
> > Wend
> >
> > resulobj.MoveFirst ' <--- here said that its foward only, that's true
> if
> > comes from a simple select ?
> >
>
> I don't understand your last question (and I have no idea about bean-like
> objects outside of gardening) but according to the Result.MoveNext()
> documentation [1]:
>
> Returns TRUE if the result is void or if there is no next record.
>
> You seem to increment your counter when the move *fails*, which will give
> you a wrong count. I usually do something like:
>
> ' Modifies the internal Result record pointer!
> Private Sub CountResult(hRes As Result) As Integer
> Dim iCount As Integer
>
> If hRes.MoveFirst() Then Return 0
> iCount = 1
> While Not hRes.MoveNext()
> Inc iCount
> Wend
> Return iCount
> End
>
> Regards,
> Tobi
>
> [1] http://gambaswiki.org/wiki/comp/gb.db/result/movenext
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list