Please help, <% rs.movefirst while not rs.eof response.write rs("article")&<hr> rs.movenext wend %> what I want: To list the first 20 articles but maybe more than or less than 20 articles in table what to change the code
you could get all the records and only display 20 by keeping a counter like <% rs.movefirst dim counter while not rs.eof if counter < 20 then response.write rs("article")&<hr> counter= counter+1 rs.movenext wend %> but this is a really bad way of doing it, just get only 20 records from the database by using the TOP keyword such as SELECT TOP 20 * FROM TableX WHERE....
This gives you the bottom 10 of the top 14, which is the same thing as a MySQL †SELECT * from MyTable LIMIT 5, 10″. If you wanted to retrieve the next 10 records, you would simply do this: