Solved

DBComboBox? what the heck

Posted on 1998-12-18
3
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dev Express grid collapse 2 54
creating threads in delphi 1 201
Firemonkey allowing RTL on android 6 77
delphi popmenu non latine charcters 3 47
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

732 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