its very simple Try this <% if n=5 then newfile.WriteLine rs("request1") end if %> The reason being you cannot have 2 script one under the other let me know if you need any help with ASP
If you want to print the recodset field value, then you can seen dyland rks example. But if you want to print as you have asked, then : <% if n=5 then newfile.WriteLine "<%=rs("request1")%>" end if %>