473,503 Members | 544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Treeview object using in ASP

Hello,
Maybe someone can help?

According to ms kb-article 183329 i am trying to populate a treeview object
on a asp-page, with realtime data from a accessdatabase.
The database routine works fine and correctly returns the required records,
the treeview object is not populated.
The syntax of the treeview1.nodes.add statement is correct (have them
written to the browser to check) but still no entries in the object.

i searched almost the entire internet ;-), but found no solution? Please
help....

Regards
Jul 19 '05 #1
2 2437
Show the code please, including the creation of the object.....

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"HarryD" <mo*******@hotmail.com> wrote in message
news:3f***********************@dreader7.news.xs4al l.nl...
Hello,
Maybe someone can help?

According to ms kb-article 183329 i am trying to populate a treeview object on a asp-page, with realtime data from a accessdatabase.
The database routine works fine and correctly returns the required records, the treeview object is not populated.
The syntax of the treeview1.nodes.add statement is correct (have them
written to the browser to check) but still no entries in the object.

i searched almost the entire internet ;-), but found no solution? Please
help....

Regards

Jul 19 '05 #2
Intention is that a database with only one table is read, which contains all
members of a family. The table contains a parent-child id as well, so,
knowing the most toplevel (which is the starting point) it is possible to
drilldown to the youngest member in the family.
I build the same stuff into VB itself (v6) and that works fine.
Code is as follows:
<%@ LANGUAGE="VBSCRIPT"%>

<%
Response.Expires = -1
dq = Chr(34)

'Open connection to database
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DBQ=D:\Inetpub\webdata\family.mdb;Driver={Microso ft Access Driver
(*.mdb)};DriverId=25;FIL=MS Access;"

Sub main()
Dim First_Node
First_Node = "F235M234"
Call Retrieve_Tree(First_Node)
End Sub

Sub Retrieve_Tree(Parent)

SQLStr = "Select ID, PartnerID, MarriageID, IDParentMarriage, Lastname,
FirstName from Persons where IDParentMarriage = '" + Parent + "' ORDER BY
DateOfBirth"
Set rs = Conn.Execute (SQLStr)

If rs.EOF Then
Exit Sub
End If

If Not rs.EOF Then
rs.MoveFirst
End If

While Not rs.EOF
strName = rs("Lastname") & ", " & rs("Firstname")
OwnID = rs("MarriageID")
ParentID = rs("IDParentMarriage")

'Nu afdrukken, maar ook functie aanroepen die TreeView1 object vult, met
parameters
'Response.Write strName & "<BR>"
Call FillTreeNew (OwnID, ParentID, strName,4)

Response.Write "<BR>"

Call Retrieve_Tree (rs("MarriageID"))
rs.MoveNext
Wend
End Sub

%>

<SCRIPT LANGUAGE="VBScript">
<%
Sub FillTreeView(OwnID,ParentID,strName)
Response.Write "TreeView1.Nodes.Add " & dq & ParentID & dq & ",tvwChild,"
& dq & OwnID & dq & "," & dq & strName & dq
End Sub
%>
</SCRIPT>

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 4</title>
<LINK HREF="/Stylesheets/content.css" REL="STYLESHEET" TYPE="TEXT/CSS">
</head>

<body>

<OBJECT ID="TreeView1" WIDTH=400 HEIGHT=500
CLASSID="CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7">
<PARAM NAME="_ExtentX" VALUE="7938">
<PARAM NAME="_ExtentY" VALUE="10583">
<PARAM NAME="_Version" VALUE="327682">
<PARAM NAME="LineStyle" VALUE="1">
<PARAM NAME="Style" VALUE="6">
<PARAM NAME="Appearance" VALUE="1">
</OBJECT>
<p>Content</p>
<HR>

<%
FillTreeNew "F235M234","NULL","STAALBERG, Hendrik", 0
Response.Write "<BR>"
Main
%>

<SCRIPT LANGUAGE="VBScript">
TreeView1.Font.Name = "Tahoma"
TreeView1.Font.Size = 9
TreeView1.Nodes.Add "NULL",0,"F235M234","STAALBERG, Hendrik"

<%
Sub FillTreeNew(OwnID,ParentID,strName,Prm)
'************ Populate the Control ******************************
Response.Write Chr(10) & "TreeView1.Nodes.Add " & dq & ParentID & dq &
"," & Prm & "," & dq & OwnID & dq & "," & dq & strName & dq & chr(10) &
chr(13)
End Sub
%>
</SCRIPT>


<%
Conn.Close
Set rs = Nothing
Set Conn = Nothing
%>

</body>

</html>

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:#w**************@tk2msftngp13.phx.gbl...
Show the code please, including the creation of the object.....

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"HarryD" <mo*******@hotmail.com> wrote in message
news:3f***********************@dreader7.news.xs4al l.nl...
Hello,
Maybe someone can help?

According to ms kb-article 183329 i am trying to populate a treeview

object
on a asp-page, with realtime data from a accessdatabase.
The database routine works fine and correctly returns the required

records,
the treeview object is not populated.
The syntax of the treeview1.nodes.add statement is correct (have them
written to the browser to check) but still no entries in the object.

i searched almost the entire internet ;-), but found no solution? Please
help....

Regards


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
821
by: feel | last post by:
Goin' crazy with this recursive function ported from delphi... I send a string like DirA/ DirB /DirC but i get in the treeView each one in a new node.Cant get the child node....!! -DirA -DirB...
2
4522
by: Trond Hoiberg | last post by:
Let say i have a bunch of files. Logfiles that is stored in subfolders. Folder1 --logfile1 --logfile2 --logfile3 Folder2 --logfile1 --logfile2 I want to display these files using data from...
8
4391
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
7
2811
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made...
6
4913
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
0
4732
by: Brian Keating | last post by:
hi there i've a test program that creates a treeview and destroys it over and over, i keep track of the gdi object count for the process and see if they are ok. However when i switch on...
10
2330
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a...
2
5481
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
0
3274
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
9
6120
by: auntiejack56 | last post by:
Hi, I've got a treeview, and I want to display the node text property that I have a) clicked on or b) highlighted using the up or down arrows
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.