Solved

DBComboBox? what the heck

Posted on 1998-12-18
3
204 Views
Last Modified: 2010-04-04
Ok heres the deal:
Im pulling one field from a table using a SQL component, of course i get a number of records (just a few, about 10).

My problem is that i want those records to be in a dbcombobox. I can get the first record of the query to display fine, but when i pull it down... nothing where are the other records?

How do i take the results of a query and place them in the items property of the combobox?????
0
Comment
Question by:joesmith69
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Oli2 earned 50 total points
ID: 1351849
How about this:

Query.First
for n := 0 to Query.RecordCount -1 do
begin
 dbComboBox.Items.Add ( Query.FieldByName ( 'xxx' ).AsString;
 Query.Next;
end;

xxx = The Name of the Field of which you want to display the Records.

You don't really need a dbComboBox for this. A normal ComboBox is good enough.
0
 

Author Comment

by:joesmith69
ID: 1351850
Thanks Oli2.
 It worked like a champ using either a normal or db combobox.

 I dont suppose you could tell me what the point of a dbcombobox is (appearantly its not for what i thought it was).
0
 
LVL 1

Expert Comment

by:Oli2
ID: 1351851
hey, joesmith69,
well, I guess the point of a dbcombobox is... errrrr...hmmmm.
Seriously : A DBComponent has a straight connection to the Database.
At some Components this looks very meaningful to me.
At some others (DBComboBox f.E.) I don't really get the clue either.

Greetings, Oli
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now