Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding nodes to a treeview from a table?
Message
 
To
26/11/2006 23:48:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01172547
Message ID:
01172562
Views:
21
>Any other way to add nodes to a treeview from a table?
>
>I have this code in my form's activate. But I get error every now and then.
>
>OLE IDispatch exception code 0 from Nodes: Key is not unique in collection.
>
>
>sele treeview
>go top
>=tableupdate(.t.)
>do while .not. eof()
>	if ckey="R"
>		lonewnode = thisform.oletreeview.nodes.add(,,alltrim(ckey),alltrim(ctext)) <--- this is where the error comes up
>	else
>		lonewnode = thisform.oletreeview.nodes.add(alltrim(crelative),crelation,alltrim(ckey),alltrim(ctext))
>	endif
>	skip
>enddo
>
Every node must have unique key, but you don't provide such a key.
if ckey="R"
   lonewnode = thisform.oletreeview.nodes.add(,,alltrim(ckey)
What if you have more than one record with ckey == [R]?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform