[Gambas-user] HOW TO MOVE IN DATASOURCE

Benoit Minisini gambas at ...1...
Sat Jan 19 23:44:34 CET 2008


On samedi 19 janvier 2008, Nx GT-R BOY wrote:
>  Hi, hope somebody help me with this one, is there a way to move the
> datasource row, to a given record, but not just by index, I mean:
>
> I can do in MySQL console something like this:
> select code from colors where person = "someone"
>
> so, I can do:
> resultado = conexion.Exec (select code from colors where person =
> "someone")
>
> Then
> resultado!code will have the record I am looking for, but how do I move my
> datasource to that record to show it at screen, I know I can do:
>
> DataSource1.MoveTo(X)
>
> But that its going to work only when "code" is numeric, what about if code
> es "RD" (for RED color), so, how do I move?, Must I add a numeric field in
> all my tables to be able to do what I want?

MoveTo(X) moves to the Xth record of the underlying Result object of the 
DataSource. It is not related at all with a possible numeric key.

But I don't know if it is possible in SQL to find the order of a specific 
query inside another query. It's beyond my sql skills... If anybody have an 
idea?

Otherwise, you have to do the search yourself, one record by one record. 
Really stupid, but if there is no other solution...

Regards,

-- 
Benoit Minisini




More information about the User mailing list