Solved

CheckListBox

Posted on 2001-07-09
4
364 Views
Last Modified: 2010-04-06
How can i add my records from database to CheckListBox component?
0
Comment
Question by:mohbb22
[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
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

726 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