I need to fix a server side script timeout issue with a classic asp page which reads several thousand rows from a database and recklessly concatenates strings to create a humongous html table.
Should I use Response.Write or use COM to create a StringBuilder?
You've identified the problem, which is always a good start. The speed issue you mention is also because string concatenation uses a significant amount of memory - I think that, once you reach the third or fourth concatenation a StringBuilder becomes more efficient.
Although I don't have any benchmarks to hand, from an architectural view my preference would certainly be to move towards writing a COM component to handle the database operations for you. You'd benefit from the increased speed that a compiled application can give, plus additional features such as sharing of database connections.
In addition, it would allow you to start building a good data model for future development if you are looking eventually to move to a more modern development platform; if planned and written carefully you may find that a significant amount of code can be reused, plus you get the chance to introduce development practises, e.g. TDD, that classic ASP doesn't [easily] support.
</personal-opinion>, obviously.