Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding nodes to a treeview from a table?
Message
 
À
26/11/2006 23:48:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01172547
Message ID:
01172562
Vues:
22
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform