Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TreeView Population from SQL Database

Posted on 1998-11-13
3
Medium Priority
?
289 Views
Last Modified: 2010-04-04
How would you go about populating the TreeView component from an Oracle Table? I would like to be able to have say OWNER as node and all TABLE_NAME as children, and COLUMN_NAME as the 3rd node. I don't want the OWNER displayed but once.
0
Comment
Question by:evansj
[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
3 Comments
 
LVL 2

Expert Comment

by:freter
ID: 1346742
Check out the TDBTreeView by Kiew Software Factory (http://www.ksf.kiev.ua)

rgds Freter
0
 
LVL 1

Accepted Solution

by:
Edo082297 earned 600 total points
ID: 1346743
Hello
  When you add a node to a treeview, if you pass nil in the parameter for the constructor of that node, it will be created at 'the root'. After that, when you pass a node in the constructor for other nodes, the nodes will appear as children of the node passed in. And so on (is this clear?). Here is some pseudo-code to get you on your way:

OpenTable

// TableNames is of type TTreeNode
Tables := Tree.Items.Add(nil);

for AllRecords do
begin
  // Add a table with the first node (Tables) as the parent
  ATable := Tree.Items.Add(Tables);
 
  for AllFieldsInATable do
  begin
    // add column nodes to the new ATable node
    AColumn := Tree.Items.AddChild(ATable);
    AColumn.Text := FieldName;
  end;
end;

This pseudo-code assumes that you have an Oracle table with all of your table names in it (did I understand that correctly?).
 
TTreeView is a sophisticated, powerful component. This should be enough to get you on your way.

Regards,
Edo

0
 
LVL 1

Expert Comment

by:Edo082297
ID: 1346744
Oh, fudge. The Add method up there takes two parameters, and should read AddChild anyway. I hope you get the idea anyway.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

721 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