PDA

View Full Version : asp paging


ansar
06-05-2003, 03:56 AM
hello friends, i have problem on paging ecords.I am selecting records by entering text in html file and send to the paging.asp.
If i enter like 'aa' in html file,it should retrive the records which starts from 'aa'.The first page gives the record which starts from 'aa' .But from second page it gives the all records from database.i send the input from html file.below is the asp file

<%

dim rs,i,strconn,strtemp,in1
in1=trim(request.querystring("text1"))
set rs=server.CreateObject("adodb.recordset")
rs.cursorlocation=3
rs.cursortype=3
rs.pagesize=10
strconn="provider=microsoft.jet.oledb.4.0;persist security info=false;data source=c:\db1.mdb"

rs.open "select * from table1 where name1 like '"&in1&"%' ",strconn

response.write "<table><tr>"
for i=1 to rs.pagecount
response.write "<td><a href=http://localhost/arthy1.asp?pg="&i&">"& i & "</a></td>"
next
response.write "</tr></table><br>"
if request("pg")="" then
rs.absolutepage=1
for i=1 to 10
response.write rs.fields("name1")& "<br>"
rs.movenext
next
else
rs.AbsolutePage=cint(Request("pg"))
for i=1 to 10
response.write rs.fields("name1")&"<br>"
rs.movenext
next
end if
%>
Help me pls
thank u

jsawkang
06-09-2003, 03:32 AM
Hi...
why don't u use session?

in1=trim(request.querystring("text1"))
Session("IN1")=in1

rs.open "select * from table1 where name1 like '"&Session("IN1")&"%' ",strconn

ansar
06-10-2003, 01:16 AM
Thank you ,
i finish the problem

jsawkang
06-10-2003, 02:45 AM
welcome