954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to make a paging?

i'm have a problem about paging. example :

1 2 3 4 ...>>

hOw to make it!

erpasoleh
Newbie Poster
2 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

You make code to accept page number in the URL then use the links to pass the page number in the URL.

nikkiH
Junior Poster in Training
79 posts since Dec 2006
Reputation Points: 13
Solved Threads: 4
 
madmital
Junior Poster
120 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5
 

That's pretty easy. You first use a Recordset, the you define the number of the records you want to be displayed per page, and you define the pageNumber you are in, and there you go. I would look like:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("datanase.mdb")' & ";" ' Accessset TheConnection = Server.CreateObject("ADODB.Connection")TheConnection.Open ConnectionStringSet RS = Server.CreateObject("ADODB.RECORDSET") RS.PageSize = 10 ' Or PageSize RS.CacheSize = PageSize RS.CursorLocation = adUseClient RS.Open "SELECT * FROM TABLE Where CONDITION_ETC;",TheConnection,3,3 CatEntries = RS_SHOW_ADS.RecordCount TotalPages = RS_SHOW_ADS.PageCount CurrentPage = CInt(Request("page")) RS.AbsolutePage = CurrentPage

Now you just need to show the data. When trying to switch between pages, remember to send along the CurrentPage-Variable. You can use the QueryString.

Good luck

Hellodear
Junior Poster in Training
53 posts since Feb 2007
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You