Solved

ListBox as Database Navigator

Posted on 1997-04-17
4
284 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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
Simple Delphi Question 9 96
how to center only a line in richedit? 4 62
Delphi: Connect to running MS Outlook 4 125
Sending files from  idTcpServer Socket to idTcpClient 2 44
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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