By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,082 Members | 2,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,082 IT Pros & Developers. It's quick & easy.

IDEAS NEEDED. PLEASE HELP

P: n/a
I have to load 1700 records from DB into tree view (NOT LIST VIEW). I have
tried
to load it with locking the windows and control and other stuff, but it not
givingme the result that I need. It takes around 18 minutes to load them
all. See I am loading those record not in one straight line (in tree view
control), but like this:
********************************
1ST MAIN CATEGORY --
1ST SUB--
SUB--
SUB --
SUB---
SUB--
SUB---
SUB--
SUB
2ND SUB--
SUB--
SUB--
SUB--
SUB--
SUB---
SUB--
SUB

2ND MAIN --
1ST SUB--
SUB--
SUB--
SUB--
SUB
2ND SUB--
SUB--
SUB--
SUB--
SUB---
SUB--
SUB--
SUB
****************************
SEE IT'S NESTING UP TO 6 LEVES. THAT WHAT I HAVE TO DO. THERE IS 27 MAIN
CATEGORIES AND THE REST OF IT SUB CATEGORIES. SOME OF THE SUB CATEGORIES OF
SUB-SUB CATEGORIES.

Please help if you can. Send me your ideas. I would greatly appreciate your
help. BY THE WAY I TRIED TO LOAD IT IN ARRAY AND THEN INTO TREE VIEW. IT'S
NOT WORKING.

HERE IS THE CODE THAT I AM USING TO LOAD THOSE RECORD. IT WORKS OK, BUT
EXTREMELY SLOW:
***********************************
Dim rs(1 To 8) As New ADODB.Recordset
Dim nodNew As Node
Set nodNew = trvOne.Nodes.Add(, , "Root", "Available Categories")

rs(1).Filter = "parent =" & "0"
Do While Not rs(1).EOF
Set nodNew = trvOne.Nodes.Add("Root", tvwChild, Chr(34) &
rs(1)!CatNumber & Chr(34), rs(1)!CatName)
Set rs(2) = rs(1).Clone
rs(2).Filter = "parent =" & rs(1)!CatNumber
Do While Not rs(2).EOF
Set nodNew = trvOne.Nodes.Add(Chr(34) & rs(1)!CatNumber & Chr(34),
tvwChild, Chr(34) & rs(2)!CatNumber & Chr(34), rs(2)!CatName)
Set rs(3) = rs(2).Clone
rs(3).Filter = "parent =" & rs(2)!CatNumber
Do While Not rs(3).EOF
Set nodNew = trvOne.Nodes.Add(Chr(34) & rs(2)!CatNumber &
Chr(34), tvwChild, Chr(34) & rs(3)!CatNumber & Chr(34), rs(3)!CatName)
Set rs(4) = rs(3).Clone
rs(4).Filter = "parent =" & rs(3)!CatNumber
Do While Not rs(4).EOF
Set nodNew = trvOne.Nodes.Add(Chr(34) & rs(3)!CatNumber &
Chr(34), tvwChild, Chr(34) & rs(4)!CatNumber & Chr(34), rs(4)!CatName)
Set rs(5) = rs(4).Clone
rs(5).Filter = "parent =" & rs(4)!CatNumber
Do While Not rs(5).EOF
Set nodNew = trvOne.Nodes.Add(Chr(34) & rs(4)!CatNumber
& Chr(34), tvwChild, Chr(34) & rs(5)!CatNumber & Chr(34), rs(5)!CatName)
rs(5).MoveNext
Loop
rs(4).MoveNext
Loop
rs(3).MoveNext
Loop
rs(2).MoveNext
Loop
rs(1).MoveNext
Loop
************************************************

THANK YOU
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.