-
Tree question
I am trying to use a Tree option in Tornado. I used the eg from the site.
But I connected to sql server instead of mdb.
When I run this I get the error
(765 : 999) Error
Error - Invalid SQL
(765 : 999) Error
Error - Invalid SQL
I ran the trace and checked out to see what it the sql it is running and
here it is
SELECT COUNT(1) FROM (Select Employeeid, Orderid, customerid From orders
group by Employeeid, Orderid, Customerid)
For some reason it is running the code replacing the table name with the
full select statement ?
Any help is greatly appreciated...
Thanks
Mani
PS here is the code I am executing
<!--T_ShowTree_3.aspx-->
<%@ Page Language="vb" Debug="true" %>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim tree As New Tornado.Z()
With tree
.dbPageSize = -1
.dbDbType="sql"
.dbDSN = "gmserver;NORTHWIND;nwind;nwind"
'.dbCommonTables = "index=EID,FullName|sql=Select Employeeid,
Firstname & ' ' & Lastname from employees"
'.dbLookUpFlds = "field=Employeeid|keyindex=EID|lookupindex=FullNam e"
.dbSQL = "Select Employeeid, Orderid, customerid From orders group by
Employeeid, Orderid, Customerid"
'... DB data source defined - use tree to present
.dbTreeParams = "wi=200| he=500|mst=5| mbg=ffffff|
mifp=aspdbmenuicons1.gif| sifp=aspdbmenuscroll.gif| fontsize2=11|
fontname0=Verdana| fontname1=Verdana| fontname2=Verdana| fontname3=Verdana|
textstyle2=1| xoffset0=4| xoffset1=4| xoffset2=4| xoffset3=3|
hovercolor0=6E6E6E| hovercolor1=6E6E6E |hovercolor2=6E6E6E
|hovercolor3=6E6E6E| opencolor0=FF0000| opencolor1=FF0000|
opencolor2=FF0000| visitedcolor0=a5a5a5| Visitedcolor1=a5a5a5|
visitedcolor2=a5a5a5| visitedcolor3=a5a5a5| nodeheight=1| Type=DB|
defaultAction=javascript:alert('Employee = [[0]] : Order ID = [[1]] :
CustomerID = [[2]]')"
Response.Write(.ASPdbTree())
End With
End Sub
</script>
-
Yes, it is indeed a bad implementation. It'll be fixed in the next release. Meanwhile add this to the code to implement a correct CountSQL ->
.dbCountSQL = "SELECT COUNT (1) From orders"
The CountSQL is used to quickly obtain the total recordcount.
Also, in SQL you must use firstname + ' ' + lastname instead of using the &.
Frank
-
1 Attachment(s)
Tree question continued
Hi,
Thanks Frank for helping there.
I was able to move next step. It didnt give any error but it did not show anything on the screen. So after drilling down I found that we have to have a folder called 'tree' inside tornado\db and there should be gif files inside it which I filled in.
But I still miss the "defaultaction". Nothing happens when I click on the last node. I was just thinking I should have missed some step like the folder or something required in the class file.Also I dont see the html tags.
Any help is greatly appreciated.
Thanks
Mani
PS
Attached is the view source of file...
-
a quickscan review that your line ->
<PARAM NAME='defaultaction' VALUE='java script:alert('Employee'>
has java script
intead of
javascript
I have the same error when I ran you code until I delete the space between a and s
why the tree/menu aux files not loaded in the installation.. I'll check that.
Frank
-
Tree question continued
Hi,
I am having a problem with navigation again.
After it displays the tree and click on the first item I get the second item being called as output...
Do I have to do anything special to call the right one?
Thanks
Mani
<% @ page language="vb" debug="true" %>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim tree As New Tornado.Z()
With tree
.dbPageSize = -1
.dbDSN = "gmserver;MPFFU;mpf;mpf"
.dbSkin="Cappuccino"
.dbSQL = "Select PelCol1,PelCol2 From gPermissionList group by PelCol1,PelCol2"
.dbCountSQL = "SELECT COUNT (1) From gPermissionList"
'... DB data source defined - use tree to present
.dbTreeParams = "wi=200| he=500|mst=5| mbg=ffffff| mifp=aspdbmenuicons1.gif| sifp=aspdbmenuscroll.gif| fontsize2=11| fontname0=Verdana| fontname1=Verdana| fontname2=Verdana| fontname3=Verdana| textstyle2=1| xoffset0=4| xoffset1=4| xoffset2=4| xoffset3=3| hovercolor0=6E6E6E| hovercolor1=6E6E6E |hovercolor2=6E6E6E |hovercolor3=6E6E6E| opencolor0=FF0000| opencolor1=FF0000| opencolor2=FF0000| visitedcolor0=a5a5a5| Visitedcolor1=a5a5a5| visitedcolor2=a5a5a5| visitedcolor3=a5a5a5| nodeheight=1| Type=DB|multinodesopening=off|defaulturl=gRightFra me.aspx|dt=disp"
Response.Write(.ASPdbTree())
End With
End Sub
</script>
-
cannot debug your DB. Use NWIND code to illustrate the rpoblem->
Dim tree As New Tornado.Z()
With tree
.dbUnit = 1
.dbPageSize = -1
.dbType = "ACCESS"
.dbDSN = "Nwind"
.dbSQL = "Select Employeeid, Orderid, customerid From orders group by Employeeid, Orderid, Customerid"
.dbCountSQL = "SELECT COUNT (1) From orders"
Dim tp As String = "wi=200| he=500|mst=5| mbg=ffffff|mifp=aspdbmenuicons1.gif| sifp=aspdbmenuscroll.gif|"
tp &= "fontsize2=11|fontname0=Verdana| fontname1=Verdana| fontname2=Verdana| fontname3=Verdana|textstyle2=1|"
tp &= "xoffset0=4| xoffset1=4| xoffset2=4| xoffset3=3|hovercolor0=6E6E6E| hovercolor1=6E6E6E |hovercolor2=6E6E6E|"
tp &= "hovercolor3=6E6E6E| opencolor0=FF0000| opencolor1=FF0000|opencolor2=FF0000| visitedcolor0=a5a5a5|"
tp &= "Visitedcolor1=a5a5a5|visitedcolor2=a5a5a5| visitedcolor3=a5a5a5| nodeheight=1| Type=DB|"
tp &= "defaultAction=javascript:alert('Employee = [[0]] : Order ID = [[1]] : CustomerID = [[2]]')"
.dbTreeParams = tp
Response.Write(.ASPdbTree())
'.ASPdbNET() see grid to confirm
End With