I was trying to paging through database results N records at a time<BR><BR>I have 3 form fields for user to submit on search page. They are Age, Gender, and Race. And I got an error like this-- If I left SQL to only "SELECT * FROM Members", I&#039ll be able to move through results set. But as soon as I add If Then conditional statement for my search criteria, it can&#039t move through.. It give me an error <BR><BR>ADODB.Recordset error &#039 800a0bcd&#039 <BR><BR>Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record. <BR><BR>That line was SQL ="SELECT * FROM Members". And here&#039s the code: Thank you very much in advance for any help // Kate<BR>-----------------------------------------------------------------------------------------------<BR>&#060;%<BR> &#039Set how many records per page we want<BR> Const NumPerPage = 25<BR><BR> &#039Retrieve what page we&#039re currently on<BR> Dim CurPage<BR> If Request.QueryString("CurPage") = "" then<BR> CurPage = 1 &#039We&#039re on the first page<BR> Else<BR> CurPage = Request.QueryString("CurPage")<BR> End If<BR><BR> Dim conn<BR> Set conn = Server.CreateObject("ADODB.Connection")<BR> conn.Open "DSN=acting"<BR><BR> &#039Explicitly Create a recordset object<BR> Dim RS<BR> Set RS = Server.CreateObject("ADODB.Recordset")<BR><BR> &#039Set the cursor location property<BR> RS.CursorLocation = adUseClient<BR><BR> &#039Set the cache size = to the # of records/page<BR> RS.CacheSize = NumPerPage<BR><BR> &#039Open recordset<BR> Dim SQL<BR> SQL = "SELECT * FROM Members"<BR>If Not Request.Form("Age") = "Any" Then<BR> If Not Request.Form("Gender") = "Any" Then<BR> If Not Request.Form("Race") = "Any" Then<BR> SQL = "SELECT * FROM Members WHERE Members.Age = " & Chr(39) & Request.Form("Age") & Chr(39) & " And Members.Gender= " & Chr(39) & Request.Form("Gender") & Chr(39) & " And Members.Race= " & Chr(39) & Request.Form("Race") & Chr(39)<BR> else<BR> SQL = "SELECT * FROM Members WHERE Members.Age = " & Chr(39) & Request.Form("Age") & Chr(39) & " And Members.Gender= " & Chr(39) & Request.Form("Gender") & Chr(39)<BR> end if<BR> else<BR> If Not Request.Form("Race") = "Any" Then<BR> SQL = "SELECT * FROM Members WHERE Members.Age = " & Chr(39) & Request.Form("Age") & Chr(39) & " And Members.Race= " & Chr(39) & Request.Form("Race") & Chr(39)<BR> else<BR> SQL = "SELECT * FROM Members WHERE Members.Age = " & Chr(39) & Request.Form("Age") & Chr(39)<BR> End if<BR> end if<BR>else<BR> If Not Request.Form("Gender") = "Any" Then<BR> If Not Request.Form("Race") = "Any" Then<BR> SQL = "SELECT * FROM Members WHERE Members.Gender= " & Chr(39) & Request.Form("Gender") & Chr(39) & " And Members.Race= " & Chr(39) & Request.Form("Race") & Chr(39) <BR> else<BR> SQL = "SELECT * FROM Members WHERE Members.Gender= " & Chr(39) & Request.Form("Gender") & Chr(39)<BR> end if<BR> else<BR> If Not Request.Form("Race") = "Any" Then<BR> SQL = "SELECT * FROM Members WHERE Members.Race= " & Chr(39) & Request.Form("Race") & Chr(39)<BR> else<BR> SQL = "SELECT * FROM Members"<BR> End if<BR> End if<BR>End If<BR><BR> RS.Open SQL, Conn, adOpenStatic, adLockReadOnly, adCmdText<BR><BR> RS.MoveFirst<BR> RS.PageSize = NumPerPage<BR><BR> &#039Get the max number of pages<BR> Dim TotalPages<BR> TotalPages = RS.PageCount<BR><BR> &#039Set the absolute page<BR> RS.AbsolutePage = CurPage<BR><BR> &#039Counting variable for our recordset<BR> Dim count<BR>%&#062;<BR>&#060;html&#062;&#060;head&#06 2;<BR>&#060;TITLE&#062;&#060;/TITLE&#062;&#060;/head&#062;<BR>&#060;% &#039Print out the current page # / total pages<BR> Response.Write("Page&#060;B&#062; " & CurPage & "&#060;/B&#062; of&#060;B&#062; " & TotalPages & "&#060;/B&#062;<BR>")<BR>%&#062;<BR>&#060;%<BR> &#039Set Count equal to zero<BR> Count = 0<BR> Do While Not RS.EOF And Count &#060; RS.PageSize<BR>%&#062;<BR>&#060;table&#062;<BR>&#0 60;tr&#062;<BR> &#060;td&#062;Name:&#060;%=RS("FirstName")%&#062;& nbsp;&#060;%=RS("LastName")%&#062;&#060;/td&#062;<BR> &#060;td&#062;Age:&#060;%=RS("Age")%&#062;&#060;&# 060;/td&#062;<BR> &#060;td&#062;Gender:&#060;%=RS("Gender")%&#062;&# 060;/td&#062;<BR> &#060;td&#062;Race:&#060;%=RS("Race")%&#062;&#0 60;/td&#062;<BR> &#060;td&#062;Location:&#060;%=RS("Country")%&#062 ;&#060;/td&#062;<BR>&#060;/TR&#062;<BR>&#060;% Count = Count + 1<BR> RS.MoveNext<BR> Loop<BR>%&#062;<BR>&#060;/TABLE&#062;<BR>&#060;%<BR>&#039Display Next / Prev links<BR> if CurPage &#062; 1 then <BR>%&#062;<BR>&#060;A href="runsearch.asp?curpage=&#060;%=curpage - 1%&#062;"&#062;Previous&#060;/A&#062;<BR>&#060;% End If %&#062;<BR>&#060;% if CInt(CurPage) &#060;&#062; CInt(TotalPages) then %&#062;<BR>&#060;A href="runsearch.asp?curpage=&#060;%=curpage + 1%&#062;"&#062;Next&#060;/A&#062;<BR>&#060;% End If %&#062;<BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062;<BR>---------------------------------------------------------------<BR><BR>