[Gambas-user] Gambas2 components?

Benoit Minisini gambas at ...1...
Wed Jan 14 14:55:36 CET 2009


On mardi 13 janvier 2009, dave L wrote:
> Hi Charles,
>
> Yes i've had a look at the code that is in the database example.
>
> by the time i went to be i had in my sample app created a link to the DB
> from cut i cout & pasted into my app from the sample DB.
>
> I suppose you have modules you call in that you pass parameters to and it
> passes back the connection and then other routines you call to fill you
> form controls with data as shown in the sample refresh form (or whatever
> it's called).
>
> anyways i will have another look at how the table connection is made and
> recordsets are done. It's the lack of these properties for those actions i
> was surprised about initially.
>
> ps thanks for your reply.
>
> dave.
>

Do you really look at the "Database" example? 

The standard database-bound controls of Gambas are located in the gb.db.form 
component.

They are somewhat sparse, but here is a quick description:

1) A DataSource container. You specifiy your request there (usually a table), 
and all data controls inserted in the container will use it.

2) If you put a DataSource A inside another DataSource B, then the DataSource 
A is filtered by the primary key of the DataSource B.

3) You have a DataControl control, that allows to edit a field by using a 
control that depends on the field datatype.

4) You have a DataCombo control, that is a ComboBox that displays an integer 
field by using it as a primary key on another tabl.

5) You have a DataView, that allows to show the contents of a DataSource in a 
GridView.

6) You have a DataBrowser, that allows to browse its parent DataSource by 
using a DataView and some buttons.

7) There is a DataComboMulti too in Gambas 3, but I didn't write nor tested 
it.

8) Theses controls are database neutral. They work with mysql, postgresql, 
sqlite, firebird...

9) The DataSource is "intelligent". It only request the records from the 
database by small packets. This way, you can put Internet between your 
application and the database, and things are perfectly usuable.

Some caveats:

10) All table must have a primary key.

11) All DataSource use the current opened connection. Having some sort 
of "Connection" property to have two DataSource controls on different 
connection is planned.

12) I think that Gareth could have made his control database neutral. But it 
is his code, so he is the boss.

Regards,

-- 
Benoit Minisini




More information about the User mailing list