On Wed, 24 Aug 2011, "Arí Ricardo Ody" wrote:

I have a SQLite 3 database that contains 2 lines.

I added a SQLite3Dataset to my project and code the following SQL Command in it:

SELECT * FROM TBLPAR

I left Active property = true

I add a Datasource and use the mentioned dataset as the associated dataset.

I add a DBComboBox and associate the datasource to it.

The DBComboBox only show the first line of the dataset. I change the SQL in the 
way the line selected became the second line. The DBComboBox shows only this 
second line.


I add a DBLookupComboBox and associate it to the same datasource. None lines 
are showed, in the both situations.

You should connect it with the LookupSource (or is it ListSource?) property,
not the datasource property.

LookupDBCombobox has 2 datasources:

DataSource : A datasource which contains the value to be shown (the value you 
edit). Datafield is the value of the field.

LookupSource: A datasource with the list of values to select from. If you select a value from the list, it will be written in the Datasource dataset's 'DataField' field.

If you just want to select a value from a dataset but not write it to a dataset
field , you cannot use DBComboBox or LookupDBCombobox. Both these components
are meant to write into a field from a dataset.

I believe the RX package has a lookupedit which allows you simply to select
a value from a lookup dataset, without writing it to another dataset.

Michael.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to