Dim strURL
Dim oTree, ParentID, Cn, Rs, Rsconexao
Set oTree = Server.CreateObject("obout_ASPTreeview_2.Tree")
oTree.FolderIcons = Server.MapPath("Icons")
oTree.FolderStyle = Server.MapPath("Classic")
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Projeto.mdb")
Cn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Rsconexao = Server.CreateObject("ADODB.Recordset")
Rsconexao.Open "SELECT * FROM tblTasks Where TaskStart = #10/23/2005# ORDER BY TaskPai, TaskOutlineNumber", Cn, 0, 3
If IsNull(Rs("TaskPai")) Then
ParentID = "root"
Else
ParentID = "id" & Rs("TaskPai") ' ID should start with character.
End If
rs.Close
oTree.Add ParentID, "id" & Rsconexao("TaskOutlineNumber"), Rsconexao("TaskName"), 0
Rsconexao.MoveNext
wend
Response.Write oTree.HTML()