|
|
|
|
|
| | |
|
Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: **How bout outputting only 10 ata a time from search results?? |
From: |
LeeChee |
Date: |
1/30/2001 2:52:36 AM |
IP: |
165.21.83.137 |
Hi,
Please refer the following code. Hope it can help you!
Rgds,
LeeChee
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!--#include virtual="/ADOVBS.inc"-->
<%
'define the record count for one page
Const NumPerPage = 10
Dim CurPage
If Request.QueryString("CurPage") = "" then
CurPage = 1 'We're on the first page
Else
CurPage = Request.QueryString("CurPage")
End If
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=MyDB"
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.CacheSize = NumPerPage
Dim strSQL
strSQL = "SELECT Name,Salary FROM Employee ORDER BY Name"
rs.Open strSQL, Conn
rs.MoveFirst
rs.PageSize = NumPerPage
Dim TotalPages
TotalPages = rs.PageCount
rs.AbsolutePage = CurPage
Dim count
|
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|