<%@ Language=VBScript %> <% if len(Request.Form("SearchFamilySize"))> 0 then SearchNumChildren=cint(trim(Request.Form("SearchFamilySize"))) end if OutOfSchool=Request.Form("OutOfSchool") dim FamSearch FamSearch="No" FamSearch=Request.Form("FamSearch") ' Yes if search search form clicked dim FamilyList() ' Array to hold a list of families for navigation 'redim FamilyList(500) redim FamilyList(50) dim FamilyCount FamilyCount=0 %> <% 'Get list of Selected Commmunities if FamSearch="Yes" then session("FamSearch")="YES" dim SelectedCommunities() redim SelectedCommunities(100) ComCount=0 set YHConn=Server.CreateObject("ADODB.Connection") YHConn.Open ConnectS MyQuery = "select * from Community where archived = 0 " set YHCommunityRS= Server.CreateObject("ADODB.RecordSet") YHCommunityRS.Open MyQuery , YHConn, 3, 3 NumCom=YHCommunityRS.recordcount 'redim SelectedCommunities(NumCom-1) do while not YHCommunityRS.EOF com=cstr(YHCommunityRS("CommunityID")) if ucase(Request.Form(com)) = "ON" then SelectedCommunities(ComCount)=com ComCount=ComCount + 1 end if YHCommunityRS.movenext loop YHCommunityRS.close set YHCommunityRS=Nothing YHConn.close SET YHConn=nothing else session("FamSearch")="NO" End if %> Young Heroes Orphan Families <% End if %>

LINKS YOUNG HEROES NEWS CHALLENGE THANKS SITE MAP CONTACT US

Young Heroes Orphan Families

We found the following families, which match your search criteria:
<% if SearchNumChildren > 0 and SearchNumChildren < 4 then %>Number of Children : <%=SearchNumChildren%> <% end if%> <% if SearchNumChildren = 4 then %>Number of Children : More than 3<% end if%>

Please choose a family by clicking on a family code. You will see a full description of the family.

<% set YHConn=Server.CreateObject("ADODB.Connection") YHConn.Open ConnectS MyCommunityQuery = "select * from Community" if FamSearch="Yes" then DoWhere="False" MySelect="" MySelect = MySelect & " Where " for x = 0 to ubound(SelectedCommunities) if len(SelectedCommunities(x)) > 0 then if x > 0 then MySelect = MySelect & " OR " end if MySelect = MySelect & " CommunityID=" & SelectedCommunities(x) & " " if SelectedCommunities(x) > 0 then DoWhere="True" end if next 'tmpMySelect = "

" & MySelect & "

" 'response.write(tmpMySelect) end if if DoWhere="True" then MyCommunityQuery = MyCommunityQuery & MySelect end if MySelect = MySelect & " and archived = 0 " MyCommunityQuery = MyCommunityQuery & " Order By CommunityName" set YHCommunityRS= Server.CreateObject("ADODB.RecordSet") YHCommunityRS.Open MyCommunityQuery , YHConn, 3, 3 do while not YHCommunityRS.EOF NumFam=GetCommunityNumFamily(YHCommunityRS("CommunityID")) %>

<%=YHCommunityRS("CommunityName")%> : <%=NumFam%> Families

<% MyQuery = "select * from Family where CommunityID=" & YHCommunityRS("CommunityID") & " and archived = 0 " MyQuery=MyQuery & " order by FamilyCode, FamilySurname" set YHFamilyRS= Server.CreateObject("ADODB.RecordSet") YHFamilyRS.Open MyQuery , YHConn, 3, 3 do while not YHFamilyRS.EOF %> <% NumChild=cint(GetFamilyNumChildren(YHFamilyRS("FamilyCode")))%> <% if SearchNumChildren > 0 then DoPrint=False if SearchNumChildren = Numchild then DoPrint=True if SearchNumChildren = 4 and NumChild >=4 then DoPrint=True %> <%if DoPrint=True then %> <% if FamilyCount < ubound(FamilyList) then FamilyList(FamilyCount) = YHFamilyRS.Fields("FamilyCode").Value FamilyCount=FamilyCount + 1 End if %> " target="_self"> <%=YHFamilyRS("FamilyCode")%> : <%=YHFamilyRS("FamilySurname")%> – <%=NumChild%> <% if NumChild = 1 then %> Child<% else %> Children<% end if %>
<% end if%> <%else ' No Criteria for Number of Children %> <% if FamilyCount < ubound(FamilyList) then FamilyList(FamilyCount) = YHFamilyRS.Fields("FamilyCode").Value FamilyCount=FamilyCount + 1 End if %> " target="_self"> <%=YHFamilyRS("FamilyCode")%> : <%=YHFamilyRS("FamilySurname")%> – <%=NumChild%> <% if NumChild = 1 then %> Child<% else %> Children<% end if %>
<%End If%> <% YHFamilyRS.movenext loop YHFamilyRS.close set YHFamilyRS=Nothing %>

<% YHCommunityRS.movenext loop YHCommunityRS.close set YHCommunityRS=Nothing YHConn.close SET YHConn=nothing %><% 'HACK: The following is a hack because when I added the code for 'archiving, it broke the search. If there is only one record returned, 'for some reason the zero based table doesn't work any more... if FamilyCount > 1 then redim preserve FamilyList(FamilyCount-1) else redim preserve FamilyList(FamilyCount) end if 'response.write("

" & FamilyCount & "

") 'for x = LBound(FamilyList) to UBound(FamilyList) ' Response.Write("
  • " & FamilyList(x) & "
  • ") 'next Session("FamilyList")=FamilyList %> <% if FamSearch="Yes" then %>

    Click here to browse all families