473,765 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Treeview object 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....
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="VBSCR IPT"%>

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

'Open connection to database
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "DBQ=D:\Inetpub \webdata\family .mdb;Driver={Mi crosoft Access Driver
(*.mdb)};Driver Id=25;FIL=MS Access;"

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

Sub Retrieve_Tree(P arent)

SQLStr = "Select ID, PartnerID, MarriageID, IDParentMarriag e, Lastname,
FirstName from Persons where IDParentMarriag e = '" + 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("IDParentMar riage")

'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="VBScr ipt">
<%
Sub FillTreeView(Ow nID,ParentID,st rName)
Response.Write "TreeView1.Node s.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="Micros oft FrontPage 5.0">
<meta name="ProgId" content="FrontP age.Editor.Docu ment">
<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="Appearanc e" VALUE="1">
</OBJECT>
<p>Content</p>
<HR>

<%
FillTreeNew "F235M234","NUL L","STAALBER G, Hendrik", 0
Response.Write "<BR>"
Main
%>

<SCRIPT LANGUAGE="VBScr ipt">
TreeView1.Font. Name = "Tahoma"
TreeView1.Font. Size = 9
TreeView1.Nodes .Add "NULL",0,"F235M 234","STAALBERG , Hendrik"

<%
Sub FillTreeNew(Own ID,ParentID,str Name,Prm)
'************ Populate the Control *************** ***************
Response.Write Chr(10) & "TreeView1.Node s.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>

Jul 19 '05 #1
2 3825
can you manually populate it at all (leaving out all the ASP lookups).
This will tell you if you have an ActiveX issue or an ASP one

--
----------------------------------------------------------
Curt Christianson (Software_AT_Da rkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"HarryD" <mo*******@hotm ail.com> wrote in message
news:3f******** *************** @dreader5.news. xs4all.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....
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="VBSCR IPT"%>

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

'Open connection to database
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "DBQ=D:\Inetpub \webdata\family .mdb;Driver={Mi crosoft Access Driver (*.mdb)};Driver Id=25;FIL=MS Access;"

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

Sub Retrieve_Tree(P arent)

SQLStr = "Select ID, PartnerID, MarriageID, IDParentMarriag e, Lastname,
FirstName from Persons where IDParentMarriag e = '" + 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("IDParentMar riage")

'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="VBScr ipt">
<%
Sub FillTreeView(Ow nID,ParentID,st rName)
Response.Write "TreeView1.Node s.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="Micros oft FrontPage 5.0">
<meta name="ProgId" content="FrontP age.Editor.Docu ment">
<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="Appearanc e" VALUE="1">
</OBJECT>
<p>Content</p>
<HR>

<%
FillTreeNew "F235M234","NUL L","STAALBER G, Hendrik", 0
Response.Write "<BR>"
Main
%>

<SCRIPT LANGUAGE="VBScr ipt">
TreeView1.Font. Name = "Tahoma"
TreeView1.Font. Size = 9
TreeView1.Nodes .Add "NULL",0,"F235M 234","STAALBERG , Hendrik"

<%
Sub FillTreeNew(Own ID,ParentID,str Name,Prm)
'************ Populate the Control *************** ***************
Response.Write Chr(10) & "TreeView1.Node s.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>

Jul 19 '05 #2
Yep, if i leave out the sub/end sub at the FillTreeNew, and leave out this
part of the body:
<%
FillTreeNew "F235M234","NUL L","STAALBER G, Hendrik", 0
Response.Write "<BR>"
Main
%>

i am able to populate the treeview manually.

"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:eG******** ******@TK2MSFTN GP12.phx.gbl...
can you manually populate it at all (leaving out all the ASP lookups).
This will tell you if you have an ActiveX issue or an ASP one

--
----------------------------------------------------------
Curt Christianson (Software_AT_Da rkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"HarryD" <mo*******@hotm ail.com> wrote in message
news:3f******** *************** @dreader5.news. xs4all.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....
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="VBSCR IPT"%>

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

'Open connection to database
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "DBQ=D:\Inetpub \webdata\family .mdb;Driver={Mi crosoft Access

Driver
(*.mdb)};Driver Id=25;FIL=MS Access;"

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

Sub Retrieve_Tree(P arent)

SQLStr = "Select ID, PartnerID, MarriageID, IDParentMarriag e, Lastname,
FirstName from Persons where IDParentMarriag e = '" + 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("IDParentMar riage")

'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="VBScr ipt">
<%
Sub FillTreeView(Ow nID,ParentID,st rName)
Response.Write "TreeView1.Node s.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="Micros oft FrontPage 5.0">
<meta name="ProgId" content="FrontP age.Editor.Docu ment">
<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="Appearanc e" VALUE="1">
</OBJECT>
<p>Content</p>
<HR>

<%
FillTreeNew "F235M234","NUL L","STAALBER G, Hendrik", 0
Response.Write "<BR>"
Main
%>

<SCRIPT LANGUAGE="VBScr ipt">
TreeView1.Font. Name = "Tahoma"
TreeView1.Font. Size = 9
TreeView1.Nodes .Add "NULL",0,"F235M 234","STAALBERG , Hendrik"

<%
Sub FillTreeNew(Own ID,ParentID,str Name,Prm)
'************ Populate the Control *************** ***************
Response.Write Chr(10) & "TreeView1.Node s.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>


Jul 19 '05 #3

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

Similar topics

3
2761
by: Steve | last post by:
Visual Studio 2003 .NET / C# I have a treeview object on a form which acts as the main menu controller for my application. the treeview is always in sight, and the form it is on acts as the main container for the whole application. All other screens are UserControls, which get added and removed from/to the main form, when the user clicks an item on the tree view. I thought the best way to handle navigating around would be to define...
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 -DirC instead of: DirA | - DirB
2
4573
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 the files in an TreeView
8
4409
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 ) {
3
3794
by: Gary Dunne | last post by:
I'm writing an app that requires drag and drop operation between a ListView and a TreeView control. (The source is the ListView). During the drag drop operation I want to be able to detect the target node in the treeview and auto expand it if applicable... but after a fair bit of head scratching I can't find any easy way to accomplish this. I think what i really need is the equivalent of the HitTest method from the COM version of the...
7
6541
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to assign to get this working. Here is some sample code: namespace WebControlLibrary1 {
2
1556
by: casManG | last post by:
I am working on a small project that uses the treeview control in .net 2003. I have a tree view that I am sending to a sub in order to iterate through the nodes. Public Sub test (ByVal inTreeView as Tree View) But, the thing I want to do with the inTreeView requires me to expand all the nodes before I iterate. The problem is that when the sub is complete, the original tree view on my form ends up with all of the nodes expanded I had...
0
3311
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. Provide following view properties to listview, through View menu a. Tile b. Icon
9
6131
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
3
4703
by: dutsnekcirf | last post by:
I have a treeview control on a custom task pane in Excel. I've enable the ability to use Drag & Drop (by following this how-to) on the treeview to change the order of the nodes. The problem though is if I close the application and then go back in, the nodes are back in the order they were before I had reordered them. Is there a way that I can modify my DragDrop event to permanently change the index of the nodes? Here's my code if you're...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7375
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.