Ask a Question related to ASP, Design and Development.
-
HarryD #1
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="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>
HarryD Guest
-
TreeView in ASP
How to fill treeview in ASP? Thanks -
Once again about treeview in ASP
Hi guys, I want to use Microsoft treeview control (no other) in my asp page and fill it with parent-child information from datatable. I draged and... -
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... -
About Treeview
Dotnet Framework 1.1 does not support IE web controls,so what's the better treeview solution now? -
ASP.NET Treeview example anyone ?
I'm trying to get the TreeView control from the Microsoft.Web.UI.WebControls namespace to work but for some reason it won't render correctly. I've... -
Curt_C [MVP] #2
Re: Treeview object in ASP
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_Darkfalz.Com)
Owner/Lead Designer, DF-Software
[url]http://www.Darkfalz.com[/url]
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"HarryD" <motocasey@hotmail.com> wrote in message
news:3f5e3374$0$37033$e4fe514c@dreader5.news.xs4al l.nl...object> Hello,
> Maybe someone can help?
>
> According to ms kb-article 183329 i am trying to populate a treeviewrecords,> on a asp-page, with realtime data from a accessdatabase.
> The database routine works fine and correctly returns the requiredall> 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 containsDriver> 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 Accessmet> (*.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,",tvwChild,"> 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 &> & 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] Guest
-
HarryD #3
Re: Treeview object in ASP
Yep, if i leave out the sub/end sub at the FillTreeNew, and leave out this
part of the body:
<%
FillTreeNew "F235M234","NULL","STAALBERG, Hendrik", 0
Response.Write "<BR>"
Main
%>
i am able to populate the treeview manually.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eGgdD5xdDHA.1620@TK2MSFTNGP12.phx.gbl...to> 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_Darkfalz.Com)
> Owner/Lead Designer, DF-Software
> [url]http://www.Darkfalz.com[/url]
> ---------------------------------------------------------
> ..Offering free scripts & code snippits for everyone...
> ---------------------------------------------------------
>
>
> "HarryD" <motocasey@hotmail.com> wrote in message
> news:3f5e3374$0$37033$e4fe514c@dreader5.news.xs4al l.nl...> object> > Hello,
> > Maybe someone can help?
> >
> > According to ms kb-article 183329 i am trying to populate a treeview> records,> > on a asp-page, with realtime data from a accessdatabase.
> > The database routine works fine and correctly returns the required> all> > 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> > 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 possibleBY> Driver> > 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> > (*.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 + "' ORDERcharset=windows-1252">> met> > 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,> ",tvwChild,"> > 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 &> > & 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;&> > <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>
> >
> >
> >
>
HarryD Guest



Reply With Quote

