Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameters as variables

Status
Not open for further replies.

baywatch

Programmer
Apr 25, 1999
1
US
I have an ActiveX treeView Control,<br>
I need to pass a node parameter (the node.name)<br>
to a textbox<br>
<br>
any Ideas??? Code Follows, notice NewNode.Key is = to strTopicTitle ----- If I could somehow pass that value...<br>
<br>
********** CODE BELOW **************************<br>
<br>
&lt;% Response.Buffer = True %&gt;<br>
<br>
&lt;!--#include file="adovbs.inc"--&gt;<br>
&lt;Html&gt;<br>
&lt;head&gt;<br>
&lt;META name=VI60_defaultClientScript content=VBScript&gt;<br>
&lt;title&gt;Shore Side Tracking&lt;/title&gt;<br>
<br>
<br>
<br>
<br>
<br>
&lt;/head&gt;<br>
<br>
&lt;Body BgColor="#FFFFFF" Link="#003366" Vlink="#006633" ALink="#000000" bgProperties=fixed&gt;<br>
&lt;!-- Top include --&gt;<br>
&lt;!--#include file="includes/top.inc"--&gt;<br>
&lt;!-- End Top SSI --&gt;<br>
<br>
&lt;Form name="treeForm" action="name.asp" method="post"&gt;<br>
&lt;table border="0" valign="top" width="100%"&gt;<br>
&lt;tr&gt;<br>
&lt;td valign="top"&gt;<br>
<br>
<br>
&lt;%<br>
Dim objConn<br>
Set objConn = Server.CreateObject ("ADODB.Connection")<br>
' Access Conection String for Development ####################################################<br>
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.mapPath("data/esd.mdb")<br>
'Oracle Connection String ####################################################################<br>
'objConn = "DRIVER={Microsoft ODBC for Oracle};UID=esdtav;SERVER=oracle;User Id=esdtav;PASSWORD=esdtav;"<br>
<br>
strSQL = "SELECT * " & "From xxx ORDER BY Esd_ID" <br>
'strSQL = "SELECT Parent, Esd_Name, esdtav_ID FROM xxx Where Class &lt;&gt; '' " & "ORDER BY Class"<br>
Set oRS = objConn.Execute(strSQL, LngRecs, 1) ' Fetch a Recordset<br>
<br>
%&gt;<br>
<br>
&lt;%<br>
Quot = Chr(34) ' Double Quotes<br>
Crlf = Chr(10) ' Carriage return<br>
<br>
Dim sTxt<br>
Dim iDex<br>
<br>
<br>
<br>
' Setup the VbScript<br>
Response.Write "&lt;script language=" & Quot & "VbScript" & Quot & "&gt;" & Crlf<br>
Response.Write "Sub window_onLoad()" & Crlf<br>
Response.Write "Dim newNode, ssChild" & Crlf <br>
Response.Write "SSTree1.LabelEdit=0" & Crlf<br>
Response.Write "SSTree1.LineStyle=1" & Crlf<br>
Response.Write "ssChild = 4" & Crlf & Crlf<br>
<br>
<br>
' Setup The Root Dir, which we call "CG"<br>
Response.Write "Set newNode = SSTree1.Nodes.Add()" & Crlf<br>
Response.Write "newNode.Key =" & Quot & "CG" & Quot & Crlf<br>
Response.Write "newNode.TagVariant = " & Quot & "REPORT1.ASP?esdid=1&" & "esdname=cg" & Quot & Crlf<br>
Response.Write "newNode.Text = " & Quot & "CG" & Quot & Crlf<br>
Response.Write "newNode.Expanded = True" & Crlf<br>
Response.Write "newnode.font.size = 8" & Crlf<br>
Response.Write "newNode.Font.Bold = True" & Crlf<br>
Response.Write "newNode.ForeColor = rgb(0,0,1)" & Crlf & Crlf <br>
<br>
<br>
'Declare Variables<br>
strCurrentClass = ""<br>
Do While Not oRS.EOF 'Loop until EOF<br>
strNewClass = oRS.Fields("ESDParent") 'Parent Nodes<br>
strTopicTitle = oRS.Fields("ESD_Name") 'Child Nodes<br>
strEsdID = oRS.Fields("Esd_ID") 'ID<br>
<br>
' Setup the control and populate it with data<br>
' Something buggy here<br>
<br>
Response.Write "Set newNode = SSTree1.Nodes.Add(" & Quot & strNewClass & Quot & ", ssChild," & Quot & strTopicTitle & Quot & ")" & Crlf<br>
Response.Write "newNode.Key =" & Quot & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.TagVariant = " & Quot & "REPORT1.ASP?esdid=" & strEsdID &"+" & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.Text = " & Quot & strTopicTitle & Quot & Crlf<br>
Response.Write "newNode.Expanded = True" & Crlf<br>
Response.Write "newNode.LoadStyleChildren = 3" & Crlf<br>
Response.Write "newnode.font.size = 8" & Crlf<br>
Response.Write "newNode.Font.Bold = True" & Crlf<br>
Response.Write "newNode.ForeColor = rgb(0,0,1)" & Crlf & Crlf <br>
<br>
oRS.MoveNext<br>
Loop ' Loop thru the Rs to pull out all the data<br>
%&gt;<br>
<br>
&lt;%<br>
' Put the finish on the VbScript<br>
Response.Write "End Sub" & Crlf<br>
Response.Write "Sub SSTree1_NodeClick(ItemClicked)" & Crlf<br>
Response.Write "If ItemClicked.Level &gt; 1 then" & Crlf<br>
Response.Write "End If" & Crlf<br>
Response.Write "End Sub" & Crlf & Crlf<br>
<br>
Response.Write "Sub button1_onclick()" & Crlf<br>
Response.Write "IF SSTree1.SelectedItem.TagVariant &lt;&gt;" & Quot & Quot & "THEN" & Crlf<br>
Response.Write "window.parent.frames(" & Quot & "reports" & Quot & ").location.href = SSTree1.SelectedItem.TagVariant" & Crlf<br>
Response.Write "End IF" & Crlf<br>
Response.Write "End Sub" & Crlf<br>
Response.Write "&lt;/SCRIPT&gt;" & Crlf<br>
%&gt;<br>
<br>
<br>
&lt;/form&gt;<br>
<br>
&lt;!-- Active Tree View --&gt;<br>
&lt;p align="left"&gt; &lt;OBJECT classid="clsid:1C203F13-95AD-11D0-A84B-00A0247B735B" height=800 id=SSTree1 <br>
style="HEIGHT: 800px; LEFT: 0px; TOP: 0px; WIDTH: 260px" width=260 name="treeview" border="2"&gt;<br>
&lt;PARAM NAME="_ExtentX" VALUE="10663"&gt;<br>
&lt;PARAM NAME="_ExtentY" VALUE="7699"&gt;<br>
&lt;PARAM NAME="_Version" VALUE="65538"&gt;<br>
&lt;PARAM NAME="BackColor" VALUE="#CCC3FF"&gt;<br>
&lt;PARAM NAME="ForeColor" VALUE="#FFFFFF"&gt;<br>
&lt;PARAM NAME="ImagesMaskColor" VALUE="12632256"&gt;<br>
&lt;PARAM NAME="PictureBackgroundMaskColor" VALUE="12632256"&gt;<br>
&lt;PARAM NAME="Appearance" VALUE="0"&gt;<br>
&lt;PARAM NAME="BorderStyle" VALUE="0"&gt;<br>
&lt;PARAM NAME="LabelEdit" VALUE="1"&gt;<br>
&lt;PARAM NAME="LineStyle" VALUE="0"&gt;<br>
&lt;PARAM NAME="LineType" VALUE="1"&gt;<br>
&lt;PARAM NAME="MousePointer" VALUE="1"&gt;<br>
&lt;PARAM NAME="NodeSelectionStyle" VALUE="1"&gt;<br>
&lt;PARAM NAME="PictureAlignment" VALUE="Left"&gt;<br>
&lt;PARAM NAME="ScrollStyle" VALUE="1"&gt;<br>
&lt;PARAM NAME="Style" VALUE="7"&gt;<br>
&lt;PARAM NAME="IndentationStyle" VALUE="1"&gt;<br>
&lt;PARAM NAME="TreeTips" VALUE="3"&gt;<br>
&lt;PARAM NAME="PictureBackgroundStyle" VALUE="5"&gt;<br>
&lt;PARAM NAME="Indentation" VALUE="12"&gt;<br>
&lt;PARAM NAME="MaxLines" VALUE="1"&gt;<br>
&lt;PARAM NAME="TreeTipDelay" VALUE="900"&gt;<br>
&lt;PARAM NAME="ImageCount" VALUE="0"&gt;<br>
&lt;PARAM NAME="ImageListIndex" VALUE="-1"&gt;<br>
&lt;PARAM NAME="OLEDragMode" VALUE="1"&gt;<br>
&lt;PARAM NAME="OLEDropMode" VALUE="1"&gt;<br>
&lt;PARAM NAME="AllowDelete" VALUE="1"&gt;<br>
&lt;PARAM NAME="AutoSearch" VALUE="1"&gt;<br>
&lt;PARAM NAME="Enabled" VALUE="1"&gt;<br>
&lt;PARAM NAME="HideSelection" VALUE="1"&gt;<br>
&lt;PARAM NAME="ImagesUseMask" VALUE="1"&gt;<br>
&lt;PARAM NAME="Redraw" VALUE="1"&gt;<br>
&lt;PARAM NAME="UseImageList" VALUE="0"&gt;<br>
&lt;PARAM NAME="PictureBackgroundUseMask" VALUE="0"&gt;<br>
&lt;PARAM NAME="HasFont" VALUE="4"&gt;<br>
&lt;PARAM NAME="Font" VALUE="arial, 8"&gt;<br>
&lt;PARAM NAME="HasMouseIcon" VALUE="0"&gt;<br>
&lt;PARAM NAME="HasPictureBackground" VALUE="0"&gt;<br>
&lt;PARAM NAME="PathSeparator" VALUE="\"&gt;<br>
&lt;PARAM NAME="TabStops" VALUE="6"&gt;<br>
&lt;PARAM NAME="ImageList" VALUE="images/book.gif"&gt;<br>
&lt;PARAM NAME="LoadStyleRoot" VALUE="0"&gt;<br>
&lt;PARAM NAME="Sorted" VALUE="1"&gt;<br>
&lt;PARAM NAME="OnDemandDiscardBuffer" VALUE="500"&gt;&lt;/OBJECT&gt;<br>
&lt;/P&gt;<br>
&lt;/td&gt;<br>
&lt;td valign="top" align="right"&gt;<br>
&lt;IFRAME align="right" Name="reports" FrameBorder="0" resizable="yes" Scrolling="auto" marginheight="2" marginwidth="2" width="500" height="800" src="/ax/report1.asp"&gt;<br>
&lt;/IFRAME&gt;<br>
&lt;/td&gt;<br>
<br>
&lt;/tr&gt;<br>
&lt;/table&gt;<br>
<br>
&lt;/body&gt;&lt;/html&gt;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top