Hi mate, i have tried to add this as a resourse but it doesnt appear in the listings. however, here is the way i do it. hope it helps.
Dan
Search Results indexing across multiple pages
This code is really simple but you have to know how request.querystrings work.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%' you need to include your database mappath location%>
<!--#Include file="cn.asp"-->
<%
'create a recordset object
Set rItems = Server.CreateObject("ADODB.Recordset")
'set the cursor location and type
rItems.CursorLocation = 3' adUseClient
rItems.CursorType = 3 'adOpenStatic
'number of rows to cache at a time. Should be set to the same as PageSize
rItems.CacheSize = 10
'number of items to display per 'page'
rItems.PageSize = 10
dim rs
dim cn
set cn = Server.CreateObject("Adodb.Connection")
cn.Open conn
sqlstring = "Select * From staffnames" 'change this to suit your db
rItems.open sqlstring, cn
'check if empty
If rItems.EOF Then
'no rows
Else
'set current page
if request.QueryString("page") <> "" then ' if page= nothing this you are on the first page without this if statement you would get an error like Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
rItems.AbsolutePage = Request.QueryString("page")
end if
'get the total number of records
nItemCount = rItems.RecordCount
'get the number of pages
nPageCount = rItems.PageCount
'loop through an display the items in the recordset
Do While Not rItems.EOF and nItem < rItems.PageSize
'displays records
response.write rItems.fields("Name")
%><br /><%
'do something
rItems.MoveNext 'move to the next record
nItem=nItem+1 'increment count
Loop
End If
'close the recordset
rItems.Close
'and destroy the object...
Set rItems = Nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<p> </p>
<p>
<%
' this loop works out the amount of pages needed and then writes them in html
dim i
i = 1
for i =1 to nPageCount%>
<a href="default2.asp?page=<%=i%>"><%=i%></a>
<%
next
%>
</p>
</body>
</html>
if you need help let me know.
Good luck!