As with most things, there are more than one way to do things. The most common way is to display a layer with the primary page hidden in another layer. The Loading.. Need to be output before the query is executed.
<HTML>
<HEAD></Head>
<Body>
<div ID=Loading_Text Style="Display: ''">
<marquee>Please Wait, Loading...</marquee>
</div>
<div ID=Main_Page Style="Display: 'none'">
All the stuff you want to display......
</div>
<script language=Javascript>
MainObj = document.all('Main_Page');
LoadObj = document.all('Loading_Text');
MainObj.style.display = '';
LoadObj.style.display = 'none';
</script>
</body>
</HTML>
This won't work on all browsers because of the java (Will work in IE), but I wouldn't be surprised if Javascript.com had some stuff to help you further.
Your other option is look in to temp tables in SQL, but above will probably work for you.