If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > How to test if parent node exists?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-01-02, 19:21
jhansell jhansell is offline
Registered User
 
Join Date: Jul 2002
Posts: 36
How to test if parent node exists?

How do I test if a parent node of a tree control exists? So far, I can't find a method, function or proerty that works. I always get an error msg saying object does not exist or object required.

I want to see if a parent node exists, and if so, then set a child of that node. If no, I want to create the parent node and then set the child node.

Any tips are greatly appreciated.

J
Reply With Quote
  #2 (permalink)  
Old 08-02-02, 03:35
Apel Apel is offline
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 228
In what language though?
You should be able to just try to access it and catch the exception if it occours.
Reply With Quote
  #3 (permalink)  
Old 08-02-02, 12:28
jhansell jhansell is offline
Registered User
 
Join Date: Jul 2002
Posts: 36
This is with an ActiveX tree control in VBA. I thought about using error trapping to catch the errors, but thought there might be a method to test if a node exist like:
Reply With Quote
  #4 (permalink)  
Old 08-02-02, 12:32
jhansell jhansell is offline
Registered User
 
Join Date: Jul 2002
Posts: 36
continued...

a method or function like:

if nodeExists(myTree.nodes.item("parentid")) then
'add child
else
'add parent
'add child
endif

I don't have much documentation on this control, and all the stuff I got off msdn doesn't say anything about checking to see if a node exists.

J
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On