I&#039m needing to perform a type of recursion lookup within an SQL database starting at the top of the tree with the parent, looking for its kids, then looking for the kids of the kids, etc., until there are no more kids. I&#039m having problems and would appreciate some help - sending many, many thanks. Specifics are: Microsoft VBScript runtime error &#039 800a000a&#039 This array is fixed or temporarily locked /directory/resultsSQL.asp, line 24 <BR><BR>Here&#039s my code (be kind - I&#039m new to this programming stuff)<BR> x=0 &#039set variables to zero<BR> z=0<BR> Dim intID(1) &#039declare array for first pass<BR> intID(0) = cint(Request.QueryString("unitID")) &#039populate array<BR> set pbkConn = CreateObject("ADODB.Connection") &#039open db connection<BR> pbkConn.Open "directory","guest",""<BR><BR> set pbkData = CreateObject("ADODB.RecordSet") &#039declare recordset and start sql stmt for parent<BR> Session("MySql") = "SELECT * FROM vwOneUnit WHERE (parentUnit = " & intID(x)<BR> <BR> set pbkDistinct = CreateObject("ADODB.RecordSet") &#039declare recordset and start first kid pass<BR> reloop()<BR> sub reloop()<BR> pbkDQuery = "SELECT unitID FROM vwDistinctParent WHERE parentUnit = " & intID(x) & " order by unitID"<BR> pbkDistinct.Open pbkDQuery, pbkConn, adOpenStatic<BR> pbkDistinct.MoveFirst<BR> Do While Not pbkDistinct.EOF<BR> x=x+1 &#039if there are kids, increment the array counter<BR> Redim Preserve intID(x) &#039redeminsio the array<BR> intID(x) = cint(pbkDistinct("unitID")) &#039populate next array member<BR> Session("MySql") = Session("MySql") & " OR parentUnit = " & intID(x)<BR> pbkDistinct.MoveNext<BR> Loop<BR> End Sub<BR> z=z+1 &#039start another counter to check each kid for kids<BR> if z &#060;= x then<BR> intID(x) = intID(z)<BR> Reloop()<BR> End if<BR> End If <BR><BR> &#039finish sql statement<BR> Session("MySql") = Session("MySql") & ") and (unitType=5) order by unitName, personFirstName "<BR> Session("Name") = pbkName("unitName")<BR> <BR> Response.redirect "resultsStaff.asp" &#039go to the return page<BR><BR><BR>