Bilgisayar Bölümü ASP Kod ve Script Arşivi


Sayfalama


Ilk nce Veritabani diye db olusturun iine veriler diye tablo yapin. Onun iinede baslik diye stun yapin Veriler tablosunu iyice doldurun. Sonra kayitlar listelensin.
<%
Set Sur = Server.CreateObject(""ADODB.Connection"")
Sur.Open ""DRIVER={Microsoft Access Driver (*.mdb)};
DBQ="" & Server.MapPath(""veritabani.mdb"")
%>
<%
Set piyonasp = Server.CreateObject(""ADODB.Recordset"")
sor = ""Select * from haber order by baslik""
piyonasp.Open sor,Sur,1,3

shf = Request.QueryString(""shf"")
If shf="""" Then
shf=1
End If

%>
<%'Veritabani bos ise
If piyonasp.eof Then
Response.Write ""<center>Veritabaninda Kayit
Yok</center>""
Response.End
End If
%>
<% piyonasp.pagesize = 10
piyonasp.absolutepage = shf
sayfa = piyonasp.pagecount
For i=1 To piyonasp.pagesize
If piyonasp.eof Then Exit For
%>
<%=piyonasp(""baslik"")%>
<hr size=""1"" color=""#006699"">
<%piyonasp.movenext%><% Next %>
Sayfa : <%
For y=1 To sayfa
If shf=y Then
response.Write y
Else
response.Write ""<b> <a
href=""""default.asp?shf=""&y&"""""">""&y&""</a></b>""
End If
Next
"

ASP Kitabı

 

Faydalılar: Altın Fiyatları |Hediye Kolye | pırlanta fiyatları
Ana Sayfa  Sık Kullanılanlara Ekle   admin[at]bilgisayarbolumu.com | © 2006 - 2023 Bilgisayarbolumu.com