Solved

Access control

Posted on 1998-09-03
3
132 Views
Last Modified: 2010-04-04
I want to use a query to select a column from a table and display it, but not in a grid. What other posibilities I have?
0
Comment
Question by:braso
3 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1338620
If there is only one colum I think TListBox is sufficient, however if you seek for multiple columns you'd better use TListView. In each case I recoment you to conduct a HIDDEN grid, make the querry and transfer the grid column to the list.
Regards, Igor
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1338621
Hey braso, hey Igor! You can also do this without a grid - just open a TQuery, and go through the records adding them wherever you want until TQuery.EOF.
0
 
LVL 7

Accepted Solution

by:
Motaz earned 20 total points
ID: 1338622
You can use List box and read the Query record set in a loop until end of Query table :

ListBox1.Items.Clear;   // Result list
Query1.First;                // Your SQL query component

while not Query1.Eof do
 begin
   ListBox1.Items.Add(Query1.Fields[0].AsString); // First field
   Query1.Next;
 end;

// That's all.. very simple !!. Isn't it ?


Motaz from Sudan.
motaz1@yahoo.com
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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