Solved

DBComboBox? what the heck

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

21 Experts available now in Live!

Get 1:1 Help Now