Solved

DBComboBox? what the heck

Posted on 1998-12-18
3
209 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…

820 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