<% Dim categoryid, adConn, rs, strSql Dim icount, catid categoryid = Request.QueryString("id") if categoryid = 70 then Response.Redirect "magnifiers.asp" end if if categoryid = 71 then Response.Redirect "microscopes.asp" end if Set adConn = Server.CreateObject("ADODB.Connection") adConn.Open Application("ConnString") icount = 0 catid = categoryid Do strSql = "SELECT CategoryID FROM Category WHERE ParentCategoryID = "& catid Set rs = adConn.Execute(strSQL) If not rs.eof then catid = rs(0) 'rs(0) = CategoryID icount = icount + 1 End If If icount > 1 Then Exit Do Loop While not rs.eof set rs = nothing adConn.Close set adConn = nothing Select Case icount Case 0 Response.Redirect "prodsumm.asp?id="& categoryid &"&type=cat&level=1" Case 1 Response.Redirect "prodsumm.asp?id="& categoryid &"&type=cat&level=0" Case Else Response.Redirect "category.asp?id="& categoryid End Select %>