I've got an ADO query (ADODB.Recordset) in VBscript that will return a result like below:
nId wstrName nParentId
0 Managed computers 2
1 Unassigned computers NULL
2 Master Server NULL
3 pseudohosts NULL
5 Server 2 0
8 Group100 5
10 Group22 5
11 Group47 5
13 Group33 5
14 Group39 5
15 Group11 5
I need to build a complete location string based on the result when I know the top level group ID.
E.g. if the top level group ID is 11 then the complete location string will be "Master Server/Managed computers/Server 2/Group47" after traversing the groups by looking at the "nId" and "nParentId" values.
The number of parent groups can vary, so I need to loop until I reach a group without a parent group. I would also like to avoid making multiple SQL queries so I'm assuming the result should get loaded into an array and then handle the information from there.
What is the best way to handle this?
Thanks in advance :)