Solved

CheckListBox

Posted on 2001-07-09
4
356 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:Mohammed Nasman
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…

831 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