<% Dim categoryid, adConn, rs, strSql Dim icount, catid categoryid = Request.QueryString("id") if categoryid = 31 then Response.Redirect "magnifiers.asp" end if if categoryid = 32 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,OverrideURL FROM Category WHERE ParentCategoryID = "& catid Set rs = adConn.Execute(strSQL) If not rs.eof then catid = rs(0) 'rs(0) = CategoryID strOverrideURL = rs(1) icount = icount + 1 End If If icount > 1 Then Exit Do Loop While not rs.eof set rs = nothing adConn.Close set adConn = nothing 'response.write "catid = "& catid &" : overrideurl = "& strOverrideURL &"
" 'response.write strSQL 'response.end if len(trim(strOverrideURL)) then Response.Redirect strOverrideURL else 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 end if 'Dim categoryid, adConn, rs, strSql 'Dim icount, catid 'categoryid = Request.QueryString("id") 'if categoryid = 31 then ' Response.Redirect "magnifiers.asp" 'end if 'if categoryid = 32 then ' Response.Redirect "microscopes.asp" 'end if 'Set adConn = Server.CreateObject("ADODB.Connection") 'adConn.Open Application("ConnString") 'icount = 0 'catid = categoryid 'strSql = "SELECT CategoryID,OverrideURL FROM Category WHERE ParentCategoryID = "& catid 'Set rs = adConn.Execute(strSQL) 'If not rs.eof then 'Do 'if len(trim(rs("OverrideURL"))) then ' Response.Redirect rs("OverrideURL") 'else ' catid = rs(0) ' 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 'end if 'If icount > 1 Then Exit Do 'Loop While not rs.eof 'End If 'set rs = nothing 'adConn.Close 'set adConn = nothing %>