VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



providing the paging concept programmatically in Active server pages

by M.santosh kumar (4 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Sat 7th December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

providing the paging concept programmatically in Active server pages

Rate providing the paging concept programmatically in Active server pages



dim rec_count
dim f_path
dim k_start,k_end 
f_path =server.MapPath("biblio.mdb") '  place the *.mdb, *.asp file in the same   directory 
set con = server.createobject("adodb.connection")
set rs = server.createobject("adodb.recordset")
set rs1 = server.createobject("adodb.recordset")

con.Provider="microsoft.jet.oledb.4.0;data source="&f_path 
con.open 

rs1.Open "select max(au_id)as rec_count from  authors  where   au_id<=500",con
rec_count =  rs1("rec_count")
dim count 
count =0 
%>

for i= 1 to  rec_count
count =count+1
if  i <=rec_count then 

if (i=1   )  then 
k_start=i
i=cint(i)+4

if (  i>rec_count)  then 
 k= i-  rec_count 
   k_end=i-k  
else  
k_end=i 
end if %>
<a href="=Request.ServerVariables("PATH_INFO")%>?k_start==k_start%>&k_end==k_end%>"> =k_start%> -=k_end%></a>|     


else
i=cint(i)+0
k_start=i
i=cint(i)+4
if (  i>rec_count)  then 
 k= i - rec_count 
 k=i-k  
 k_end=k
    else  
k_end=i
end if 

%>
<a href="=Request.ServerVariables("PATH_INFO")%>?k_start==k_start%>&k_end==k_end%>"> =k_start%> -=k_end%></a>|     
</b>


end if 

 end if 
 if (  count >9)  then 
 Response.Write "<Br>"
 count =0
 end if     
 
next 
%>
<table  border=0  cellspacing=1  cellpadding =2  >

dim   rec_start,rec_end 
rec_start=  trim(Request("k_start"))
rec_end = trim(Request("k_end"))
if( len(rec_start)>0  and  len(Rec_start)>0 )  then
rs.Open "select * from  authors where au_id>="&cint(rec_start)&" and  au_id<="&cint(rec_end)&"",con
  while  not  rs.EOF 
  Response.Write rs("au_id")&" = " &  rs("author") &"<Br>"
  rs.MoveNext : wend 
end if 
%>
</table>

Download this snippet    Add to My Saved Code

providing the paging concept programmatically in Active server pages Comments

No comments have been posted about providing the paging concept programmatically in Active server pages. Why not be the first to post a comment about providing the paging concept programmatically in Active server pages.

Post your comment

Subject:
Message:
0/1000 characters