<% if request.Item("searchstring") <> "" then searchstring = request.Item("searchstring") searcharray = split(searchstring," ") nameID = ":" schoolID = ":" hits = 0 Total = 0 TableCount = 0 StopHits = "false" %>
<% function hitcounter hits = hits + 1 if hits > 15 then Total = Total + hits TableCount = TableCount + 1 if TableCount >= 3 then StopHits = "True" response.Write("Mer än "&Total&" träffar.") else %><% end if hits = 0 end if end function for I=0 to ubound(searcharray) sql = "SELECT * FROM fabrik WHERE Namn LIKE '%"&searcharray(I)&"%'" set rs =BnetConnection.Execute(sql) do until rs.eof or StopHits = "True" namecheck = ":"&rs("fabrikID")&":" if inStr(nameID,namecheck) < 1 then response.Write(" "&rs("namn")&"
") nameID = nameID & rs("FabrikID")&":" hitcounter end if rs.movenext loop sql = "SELECT * FROM Produkt WHERE namn LIKE '%"&searcharray(I)&"%'" set rs =BnetConnection.Execute(sql) do until rs.eof or StopHits = "True" namecheck = ":"&rs("ProduktID")&":" if inStr(nameID,namecheck) < 1 then response.Write(" "&rs("namn")&"
") nameID = nameID & rs("ProduktID")&":" hitcounter end if rs.movenext loop sql = "SELECT * FROM person WHERE fornamn LIKE '%"&searcharray(I)&"%'" set rs =BnetConnection.Execute(sql) do until rs.eof or StopHits = "True" schoolcheck = ":"&rs("PersonID")&":" if inStr(SchoolID,schoolcheck) < 1 then response.Write(""&Trim(rs("fornamn"))&" "&Trim(rs("efternamn"))&"
") SchoolID = SchoolID & rs("PersonID")&":" hitcounter end if rs.movenext loop next end if %>