%
Dim AdoCon
Dim RsSearch
Dim SQLProj
Dim RsPrc
Dim SQLPrc
Dim Uname
Dim SQLSearch
Dim SQLL
Dim i
sqlOP = request.querystring("SQLP")
SQLGEN = request.form("TXTSQL")
If Request.QueryString("NAV") = "" Then
intPage = 1
Else
intPage = Request.QueryString("NAV")
End If
'------Create Connection-----------------------------------
Set AdoCon = server.createobject("ADODB.CONNECTION")
AdoCon.Open "Driver={MICROSOFT ACCESS DRIVER (*.mdb)};DBQ=" & server.mappath("/DB/fh.mdb")
if sqlOP = "" then
SQLSearch="select * from ListedProperties where propID <> 0 " & SQLGEN
else
SQLSearch = sqlOP
end if
'response.write SQLSearch
Set RsSearch = server.createobject("ADODB.RECORDSET")
'----------------------------------------------------------------
RsSearch.CursorLocation = 3 'adUseClient
RsSearch.CursorType = 3 'adOpenStatic
RsSearch.ActiveConnection = AdoCon
' If Request.QueryString("NAV") = "" Then
RsSearch.Open SQLSearch,AdoCon,3,3
' end if
RsSearch.PageSize = 5
Dim intRecordCount
RsSearch.CacheSize = RsSearch.PageSize
intPageCount = RsSearch.PageCount
intRecordCount = RsSearch.RecordCount
If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount
If CInt(intPage) <= 0 Then intPage = 1
If intRecordCount > 0 Then
RsSearch.AbsolutePage = intPage
intStart = RsSearch.AbsolutePosition
If CInt(intPage) = CInt(intPageCount) Then
intFinish = intRecordCount
Else
intFinish = intStart + (RsSearch.PageSize - 1)
End if
End If
%>
<%RsSearch.MoveNext%>
<%If RsSearch.EOF Then Exit for%>
<%Next%>
<%' Check to see if the current page is greater than the first page
' in the recordset. If it is, then add a "Previous" link.
If cInt(intPage) > 1 Then
%>
« Prev |
<%End IF%>
<%
' Check to see if the current page is less than the last page
' in the recordset. If it is, then add a "Next" link.
If cInt(intPage) < cInt(intPageCount) Then
%>
Total Pages: <%=intPageCount%>   Current Page :<%=intPage%> Go to page
<%Dim counter
cp = intPage
for counter = 1 to intPageCount%>
|
<%
if counter = cint(cp) then%>
<%end if%>
<%response.write counter
next
%>
|Next »
<%End If%>
<%End If%>