29 messaggi dal 07 settembre 2001
quando clicca su successiva mi riporta tutti i record del db anziche' solo quelli da me richiesti

perche'?

ecco il codice:
<% Option Explicit

Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdTableDirect = &H0200
Const adUseClient = 3
%>
<%
Dim connStr
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb")

Dim rs, SQL
Set rs = Server.CreateObject("ADODB.Recordset")

rs.PageSize = 1
rs.CacheSize = 1
rs.CursorLocation = adUseClient
SQL = "SELECT * FROM links where link_desc like'%" & request.form("search") & "%'"

rs.open SQL, connstr, 1, 3

If Len(Request("pagenum")) = 0 Then
rs.AbsolutePage = 1
Else
If CInt(Request("pagenum")) <= rs.PageCount Then
rs.AbsolutePage = Request("pagenum")
Else
rs.AbsolutePage = 1
End If
End If

Dim abspage, pagecnt
abspage = rs.AbsolutePage
pagecnt = rs.PageCount

If Not rs.EOF Then
Response.Write "PageCount : " & rs.PageCount & "<br>" & vbcrlf
Response.Write "Absolute Page : " & rs.AbsolutePage & "<br>" & vbcrlf
Response.Write "Total number of records : " & rs.RecordCount & "<br><br>" & vbcrlf

Dim fldF, intRec
Response.Write "<table border=0 align=center cellpadding=3 cellspacing=0>"
For intRec=1 To rs.PageSize
If Not rs.EOF Then
Response.Write rs("LINK_NAME")
' For Each fldF in rs.fields("LINK_NAME")
' Response.Write "<td>" & fldF.Value & "</td>"
' Next

rs.MoveNext
End If
Next
Response.Write "</table><p>"
response.write "<br>" & abspage
response.write "<br>" & pagecnt
response.write "<br>"
dim ultima
ultima = pagecnt

response.write "<div align=center>"

If abspage = 1 Then
Response.Write "<span style=""color:silver;""><< Precedente</span>"
Else
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage - 1 & """><< Precedente</a>"
End If


Response.Write " | "
If abspage < pagecnt Then
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage + 1 & """>Successiva >></a>"
Else
Response.Write "<span style=""color:silver;"">Successiva >></span>"
End If


Else
Response.Write "No records found!"
End If
response.write "</div>"
rs.Close
Set rs = Nothing
%>


ciao

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.