• 27-03-2016, 11:09:31
    #1
    <table border="0" width="956" cellspacing="10" cellpadding="3">
      <tr>
        <td width="100%" colspan="5" bgcolor="#51A8FF" height="32"><font color="#FFFFFF"
        face="Arial" size="3">&nbsp;&nbsp;Muhasebe Programı - Cari Hesaplar</font></td>
      </tr>
    <tr>
    <td width="45" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" align="center"></td>
    <td width="235" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)"><font color="red" face="Arial" size="2">&nbsp;<b>Müşteri Adı</b></td>
    <td width="212" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)"><font color="red" face="Arial" size="2">&nbsp;<b>Telefon</b></td>
    <td width="372" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)"><font color="red" face="Arial" size="2">&nbsp;<b>Adres</b></td>
    <td width="92" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" align="center"><font color="red" face="Arial" size="2">&nbsp;<b>Düzenle</b></td>
    </tr>
    
    <%
    Set iletcen = Conn.Execute("SELECT COUNT(*) AS records FROM contact;" )
    intRecords = Int(iletcen("records" ))
    iletcen.Close
    Set iletcen = Nothing
    
    
    'degiskenleri aatiyoruz
    intPage = Request.QueryString("sayfa" )
    If intPage = "" OR not IsNumeric(intPage) Then
        intPage = Int(1)
    Else
        intPage = Int(intPage)
    End If
    intPageSize = Int(5)
    intStart = intPage*intPageSize
    intStart = intStart-intPageSize
    intPages = Int(intRecords/intPageSize)+1
    
    Set iletcen = Conn.Execute("SELECT * FROM contact LIMIT " & intStart & ", " & intPageSize & ";" )
    
    
    
    If iletcen.Eof or iletcen.Bof Then
    Response.Write "kayit yok"
     Else
    Do Until iletcen.Eof
    
    
    If  iletcen("category_id") = 6 Then 
    else
    %>
    <tr>
    <td width="45" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" align="center" onclick="location.href='muhasebe_cari_detay.asp?id=<%=iletcen("id")%>';"><img src="images/user.png"></td>
    
    
    <td width="235" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" onclick="location.href='muhasebe_cari_detay.asp?id=<%=iletcen("id")%>';"><font color="#000000" face="Arial" size="2">&nbsp;<%=iletcen("name")%></td>
    
    
    <td width="212" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" onclick="location.href='muhasebe_cari_detay.asp?id=<%=iletcen("id")%>';"><font color="#000000" face="Arial" size="2">&nbsp;<%=iletcen("mobile_phone")%> - <%=iletcen("phone")%></td>
    
    
    <td width="372" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" onclick="location.href='muhasebe_cari_detay.asp?id=<%=iletcen("id")%>';"><font color="#000000" face="Arial" size="1">&nbsp;<%=iletcen("address1")%></td>
    
    
    <td width="92" height="26" bgcolor="#FFFFFF" style="border: 1px dotted rgb(81,168,255)" align="center" onclick="location.href='muhasebe_cari_detay.asp?id=<%=iletcen("id")%>';"><a href="muhasebe_cari_detay.asp?id=<%=iletcen("id")%>"><font color="#000000" face="Arial" size="2">&nbsp;İNCELE</a></td>
    
    </tr>
    
    <%
    
    End if
    
    iletcen.Movenext
     Loop
     End If 
    
    
    
    iletcen.Close
    Set iletcen = Nothing
    
    'sayfaliyoruz
    For i = 1 To intPages
        If i = intPage Then
            Response.Write "<b>" & i & "</b> "
        Else
            Response.Write "<a href=""muhasebe_musteriler.asp?sayfa=" & i & """>"
            Response.Write i
            Response.Write "</a> "
        End If
    Next
    
    Conn.Close
    Set Conn = Nothing
    
    %>
    
    </table>

    Merhaba arkadaşlar yine ben. kusura bakmayın vaktinizi alıyorum ama yine bir konuda takıldım... bir syafaya sayfalama yapmam gerekiyor. yüzlerce veri çıkıyor sayfada. ama bir türlü yapamadım.

    Sayfalamayapmaya çalıştığım sayfanın kodları yukarda.. bir türlü yapamadım.


    aldığım hata ilginç :

    Microsoft VBScript çalýþma hatasý hata '800a01a8'

    Nesne gerekli: ''

    ?, satır 0


    yardım ederseniz sevinirim. kolay gelsin.
  • 27-03-2016, 17:35:49
    #2
    <%
      const pageSize = 5
      page = request( "page" )
      if not isNumeric( page ) or page = "" or page < 1 then page = 1
    
      query = "SELECT * FROM table_name LIMIT "& (page - 1) * pageSize & "," & pageSize
      set rs = createObject( "ADODB.Recordset" )
      rs.cursorLocation = 3
      rs.open query, db, 1, 3
      response.write rs.recordCount
    
      do until rs.EOF
        response.write rs( "column_name" ) & "<br>"
      rs.movenext : loop
    
    
      for i = 1 to rs.recordCount
        with response
          if i = cint( page ) then
            .write "["& i &"] | "
          else
            .write "[<a href=?page="& i &">"& i &"</a>] | "
          end if
        end with
      next
    %>
    Bu kodu kendine göre uyarla. Recordset sayesinde kayıt sayısını almak için fazladan bir sorgu daha çalıştırmak zorunda kalmazsın.

    Biraz önce yazdım ve test ettim. Şu çalışmıyor, şöyle hata veriyor demezsen sevinirim.

    Allah kolaylık versin.