Solved

Access control

Posted on 1998-09-03
3
131 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
control image tags in a string ? 12 111
tvirtualstringtree freeze when load too manny images 10 52
JAudiorecorder record freezing the app 29 60
Dev express lookupcombo 3 13
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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