Solved

Access control

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

9 Experts available now in Live!

Get 1:1 Help Now