title: While loop times out in ASP classic page
body: <p>My boss wrote this very intricate piece of software like 10 years ago and asked me to migrate it on a new IIS 7 server that I just set up on a VPS. I managed to get everything working smoothly except for a tiny loop that times out and sends the CPU to 100%.</p>
  
  <p>Here's the culprit:</p>
  
  
  
  <pre class="lang-vbs prettyprint-override"><code>rs_ss.open  "SELECT DISTINCT idMC, idUtente, Categoria FROM forte01.RisorseS WHERE idmc=" &amp; request.querystring("idmc") &amp; " and idutente=" &amp; session("idutente") &amp;  " order by  categoria" ,conn 
  
  if not rs_ss.eof then
       do while not rs_ss.eof
  
          'conta gli elementi della sottosezione
          rse.filter ="categoria='" &amp; rs_ss("categoria") &amp; "'"
          if not rse.eof then
              n=0
              do while not rse.eof        
                  rse.movenext
                  n=n+1
              loop
              rse.movefirst   
              r=1
              do while not rse.eof
                  dettagliarisorse rse, "s_ss",r ,n
                  r=r+1
                  rse.movenext
              loop
          end if
          rse.filter =""
          rs_ss.movenext
       loop
  end if
  rs_ss.close
  </code></pre>
  
  <p>If I just delete or comment out the central part like so:</p>
  
  <pre class="lang-vbs prettyprint-override"><code>rs_ss.open  "SELECT DISTINCT idMC, idUtente, Categoria FROM forte01.RisorseS WHERE idmc=" &amp; request.querystring("idmc") &amp; " and idutente=" &amp; session("idutente") &amp;  " order by  categoria" ,conn 
  
  if not rs_ss.eof then
   do while not rs_ss.eof
     rs_ss.movenext
   loop
  end if
  rs_ss.close
  </code></pre>
  
  <p>it keeps doing it.</p>
  
  <p>On the old domain it works without a problem. Any ideas why?</p>