Solved

ListBox as Database Navigator

Posted on 1997-04-17
4
282 Views
Last Modified: 2010-04-04
How can I put a listbox on a form that shows the value of a specific field all records deep?

How can I make clicks on this ListBox navigate in the database?

I want this ListBox to change if I change the database.

Can it be done at all?
0
Comment
Question by:alona041797
  • 2
4 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1335441
Isn't it what you're trying to do just a single dbgrid with only one field in the Fields Editor??
0
 

Expert Comment

by:sholmes
ID: 1335442
This is a suggestion seeing that I really have no clue what you are attempting.  It seems to me though that you could accomplish this by making a DBGrid pretend to be a ListBox.  Set the grid up so that the DBGrid displays only one field, the field you are interested in.  Set its width accordingly. You could also get rid of the grid lines, etc.  You would think it was a list box when it was done.  Let me know if this is what your after and I can help.

Other words, check this out.

Add records to listbox

with Table1 do
begin
while not EOF do
begin
 ListBox1.Items.add(fields[0].asString);
end;
end;


now, in you listbox onClick event you can reference the item using ListBox.Items[ListBox.ItemIndex]

Use this string to perform a search and place the cursor on the
record.

There would be some table functions and maybe some sql's here, however, it could be done.



0
 
LVL 2

Author Comment

by:alona041797
ID: 1335443
Yes. This is what I'm after, please elaborate more and ANSWER the question instead of just COMMENTing on it.
0
 
LVL 2

Accepted Solution

by:
javiertb earned 50 total points
ID: 1335444
I think that's what I told before sholmes. But it'll be really slow if you try to navigate through the database using a search for each record you move to. Definately it's very slow. Just use a DBGrid, make it appear however you want and make it show only one record by means of its editor. This way you'll be able to move through the database just as if you had a listbox.
If you really need a more elaborated answer let me know, but I think there's not too much to elaborate here.

Hope this help
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

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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

943 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