% Response.CacheControl = " no-cache" %> <% Response.AddHeader " Pragma" , " no-cache" %> <% Response.Expires = -1 %>
<% %> <% ' BEGIN RUNTIME CODE ' Declare our vars Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPageCurrent 'The page we want to show Dim strOrderBy 'A fake parameter used to illustrate passing them Dim sql 'SQL command to execute Dim objPagingConn 'The ADODB connection object Dim getRec 'The ADODB recordset object Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I 'Standard looping var Dim getRec1 'The ADODB recordset object for changing of jobstatus ' Get parameters iPageSize = 20 ' You could easily allow users to change this ' Retrieve page to show or default to 1 If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If ' Set connection to database Set conn = Server.CreateObject("ADODB.Connection") conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _ Server.MapPath("jobsystem.mdb")) ' SQL statement to set all data where Jend date has expired sql = "Update URL SET JobStatus = 'No' WHERE JEnd < Now()" set getRec1=conn.execute(sql) ' SQL statement to get all data where jobstatus = yes and sort according to data in descending order sql = "SELECT * FROM URL WHERE JobStatus = 'Yes' ORDER BY JStart DESC" set getRec=conn.execute(sql) ' Create recordset and set the page size Set getRec = Server.CreateObject("ADODB.Recordset") getRec.PageSize = iPageSize getRec.CacheSize = iPageSize ' Open RS getRec.Open sql, conn, adOpenStatic, adLockReadOnly, adCmdText ' Open RS for getRec1 getRec1.Open sql, conn, adOpenStatic, adLockReadOnly, adCmdText ' Get the count of the pages using the given page size iPageCount = getRec.PageCount ' If the request page falls outside the acceptable range, ' give them the closest match (1 or max) If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 %>
|
|||||||||||||||||||||||||||||||||||
<% If iPageCurrent > 1 Then %>
[<< Prev]
<%
End If
' You can also show page numbers:
For I = 1 To iPageCount
If I = iPageCurrent Then
%>
[ <%= I %> ]
<%
Else
%>
[ <%= I %> ]
<%
End If
Next 'I
If iPageCurrent < iPageCount Then
%>
[Next >>]
<%
End If%>
|
|||||||||||||||||||||||||||||||||||
| Willing to re-locate and work in Singapore? Click Here! | |||||||||||||||||||||||||||||||||||
| Company Profile | Our Services | Contact Detail | Job Services | Log In | |||||||||||||||||||||||||||||||||||