Solved

TreeView Population from SQL Database

Posted on 1998-11-13
3
287 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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