[Gambas-user] DataCombo doesn't work

Benoît Minisini gambas at ...1...
Tue Sep 1 12:08:39 CEST 2009


> Hi,
> I'm experimenting with a DataCombo. Maybe I'm wrong again, but as I
> understand, it should work like this:
>
> Let's say I have a movie database.
> The table "movie" is in my DataSource.
> In this table is a field "Directors_ID", the directors are stored in the
> table "directors", where there is a field "Name". Then I would put a
> DataCombo in my DataSource with the properties: Field = "Directors_ID"
> Table = "directors"
> Display = "Name"
>
> But all I get is "Query failed: SQL error or missing database".
> (the database is sqlite, but that shouldn't matter?)
> When I test it with Field = "id", I get a greyed DataCombo with a name, but
> of course with the wrong index.
>
> What am I doing wrong or thinking wrong?
>

If I remember, DataCombo only works if the primary key of the "directors" 
table is "Directors_ID", with the same field name. Is it the case?

> Of course, I can use code and fill a TextBox or ComboBox with the names,
> but - would be nice without, and
> - what would be the event to react to, if the record is changed? In VB this
> was some "RecordChanged" or so event, easy to use, but here I can't find
> anything.

There is no such event. I agree it may be useful, so I will add it in Gambas 
3.

Regards,

-- 
Benoît




More information about the User mailing list