Solved

CheckListBox

Posted on 2001-07-09
4
361 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connection between libmysql.dll and MySQL Versions 7 130
Intraweb download file link ? 1 180
How to debug For loops? 3 71
Microsoft Access 97 and Delphi XE2 9 82
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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