Paging and caching large record sets
Welcome to our next foray into database driven ASP development. Today
we're going to be looking at viewing large record sets, and how to optimise
this process both for the person doing the viewing and for the server processing
the page. To handle the former, we'll use a technique known as paging, and
for the latter, caching. This caching is not the client side browser caching
we've all come to know and hate; this caching is done entirely on the server.
Let's jump right in!
Creating the page with the recordset
First off, we're going to create a simple page using Dreamweaver, which will
use a standard Dreamweaver connection to create a standard Dreamweaver recordset.
We will then use a Server Behaviour to display the contents of this recordset.
1. Create the connection
As in the previous tutorial, we're going to use a DSN (Data Source
Create the DSN
Copy the database file to your web server folder (It's in the link "Code
download" below the download
Click Start > Programs > Administrative Tools > Data sources
( ODBC )
the System DSN tab, and click Add…
the Microsoft Access Driver (*.mdb)
a name for your new data source. I've called mine PagingSample.
the Select… button and browse to your copy of PagingSample.mdb.
You should see the path to PagingSample.mdb above the select button.
OK to close the Data sources panel.
Before you can define a Connection with Dreamweaver, you will need
to create a new Site first. If you have not done so, be sure to do so now.
(Molly Holzschlag has a tutorial
on setting up your site, if you're unsure how).
Create the Connection in Dreamweaver
If your Application panel group is not visible, use Window > Databases
to make it appear.
Click the + icon in the Databases panel, and select Data Source
Name (DSN) from the list.
a name for your new connection, I used PagingSample.
your DSN from the drop-down list.
Click the Test button. You should see a message: 'Connection
was made successfully.'
OK on the notification, and click OK again to save the new Connection.
should now see a Connection in the Databases panel.
And you're done! You should now be able to browse through the database's
tables, views, and stored procedures. This database contains a single table,
Orders. For the sake of clarity, I haven't normalised the data for