Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

DBComboBox

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Arí Ricardo Ody

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.

I add a DBGrid too. It acts as expected, e.g., show all selected lines.

May someone tell me what's happen here? I can't use a DBComboBox to select a field from a table? It doesn't show all lines in the table? And about DBLookupComboBox? Where am I making mistakes? I'm not sure but I think that I used these components in the way described above when I was programming in Delphi 2007.

I was trying to do this in windows 7, but I pretend to run the program in windows mobile

Greetings from Sao Paulo - Brasil

Ricardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110824/01e79b56/attachment.html>

Reply by email

Unknown author
to Arí Ricardo Ody
"Ar? Ricardo Ody" wrote 16 lines
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.

Reply by email

Arí Ricardo Ody

Hi Michael!

I beg your pardon but I don't understand your explanation about DBComboBox and DBLookupComboBox. I only want to show a list of codes contained in a SQLite 3 SQL table column and select one them.

About the rx 1.0: I install it via Package|Install/Uninstall packages, uninstall and install again and can't find new Data Controls(twice) in my 0.9.30 Ide.

Cheers

Ricardo

Earlier message 10 lines
----- Original Message ----- From: Sent: 08/24/11 05:09 AM To: Lazarus mailing list Subject: Re: [Lazarus] DBComboBox 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110824/d25777a0/attachment.html>

Reply by email

Лагунов Алексей
to Arí Ricardo Ody

Install rxfpc from LazarusCCR.

? ???, 24/08/2011 ? 11:46 +0000, "Ar? Ricardo Ody" ?????:

Show quoted text 75 lines
Hi Michael! I beg your pardon but I don't understand your explanation about DBComboBox and DBLookupComboBox. I only want to show a list of codes contained in a SQLite 3 SQL table column and select one them. About the rx 1.0: I install it via Package|Install/Uninstall packages, uninstall and install again and can't find new Data Controls(twice) in my 0.9.30 Ide. Cheers Ricardo > ----- Original Message ----- > > From: > > Sent: 08/24/11 05:09 AM > > To: Lazarus mailing list > > Subject: Re: [Lazarus] DBComboBox > > > > 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 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110824/ce5ae2ce/attachment.html>

Reply by email