Solved

ListBox as Database Navigator

Posted on 1997-04-17
4
285 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
[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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Working with hours 3 88
How to build JSON File in Delphi 6 3 95
RESTRequest Parameter 4 81
idtcpserver and idtcpclient encryption using ssl 17 12
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 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