Hey you ASP masters out there. I need an expert!!!

I use a form to derive the WHERE clause of a SQL statement. From the recordset that's generated, I use ths page breakdown thing that I found on ASP Watch. It works great on the first page (or on pages where the SQL statement is Hardcoded) but where the SQL statement is dynamic (from the form), it divides up the pages, and links them properly, but when I try to move to the 2nd or latter pages, I get an error stating a problem with the "WHERE" clause.

My guess is that I have to somehow pass the user input to each page... But that doesn't make sense since the recordset is already generated!!!! I don't know. Any suggestions??

strSQL = strSQL & " WHERE " & varSQL
oRS.Open strSQL, oConn, adOpenStatic, , adCmdText

If oRs.RecordCount > 0 then
response.write "<p>Your searched yielded " & oRS.Recordcount & " results. Here they are: </p>"


If not isEmpty(Request.QueryString("pageno")) then pageno=Request.QueryString("pageno") else pageno=1

for page=1 to oRS.PageCount
links=links & "<a href='test-resp.asp?pageno=" & page & "'>Page "&page&"</a>"
if page < oRS.PageCount then
links=links & " | "
end if
links=links & "</p>"
response.write links

for intRecord =1 to oRS.PageSize

'OuTput HeRe

if oRS.EOF then
exit for
end if

I'll give you much internet props if you can help!!!!