Solved

CheckListBox

Posted on 2001-07-09
4
348 Views
Last Modified: 2010-04-06
How can i add my records from database to CheckListBox component?
0
Comment
Question by:mohbb22
4 Comments
 
LVL 5

Accepted Solution

by:
TheNeil earned 100 total points
ID: 6265750
Iterate through the data.

CheckListBox1.Items.Clear;
Data.First;
WHILE NOT(Data.EOF)
DO
BEGIN
  CheckListBox1.Items.Add(Data.FieldByName(<Field Name).AsString);
  Data.Next;
END;

Obviously you'll have to change Data to be your data object and insert a field name into the Items.Add statement but the idea is the right one

The Neil =:)
0
 
LVL 22

Expert Comment

by:mnasman
ID: 6266602
Hell

this code will add the field company from customer table to the checklistbox
var
  I : integer;
begin
  for I := 0 to Table1.RecordCount -1  do
  begin
    CheckListBox1.Items.Add(Table1['company']);
    Table1.Next;
  end;

and if u want u can  add more fields in the same item :

  CheckListBox1.Items.Add('CustNo= ' + IntToStr(Table1['CustNo']) + ', Company= ' + Table1['company']);

Best regards
Mohammed Mohammed
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8702679
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To accept TheNeil's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

14 Experts available now in Live!

Get 1:1 Help Now