Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiselect listbox bound to database in Delphi 6

I'm using Delphi 6, and I want a database bound list box with multiselect. I found three types of List boxes: TListBox, TDBListBox and TDBLookupListBox.

As far as I can understand, TListbox is not bound to database. TDBListBox and TDBLookupListBox can't be multiselected.

Is there a way to get a multiselect listbox binded to database?

like image 531
Blue Avatar asked Dec 31 '22 08:12

Blue


2 Answers

The problem with databinding components is that they rely on a datasource and a datasource has only a single cursor. That is probably the reason why.

By the way, do you need to change the data? Else you could fill a normal listbox from a dataset. Or even use an invisible data listbox and copy the contents to a normal listbox.

like image 190
Toon Krijthe Avatar answered Jan 06 '23 00:01

Toon Krijthe


Not as far as I know.
The standard is that you offer with the list a bunch of values in which 1 represents the current record.
Unless you have a multivalued field (against best practices) I can't see how you could multiselect...

Or what you might want is actually a sub-table?

like image 41
Francesca Avatar answered Jan 06 '23 00:01

Francesca