IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   Visual Basic (https://www.ircforumlari.net/visual-basic/)
-   -   Geçerli Sayfayı Bulmak (https://www.ircforumlari.net/visual-basic/124731-gecerli-sayfayi-bulmak.html)

Cemalizim 21 Temmuz 2008 18:26

Geçerli Sayfayı Bulmak
 
PHP- Kodu:

 Option Explicit
Dim db 
As Connection
Dim lCurrentPage 
As Long

Private Sub cmdNext_Click()
    
lCurrentPage lCurrentPage 1
    Call LoadListBox
(lCurrentPage)
End Sub

Private Sub cmdPrevious_Click()
    If 
lCurrentPage 1 Then
        lCurrentPage 
lCurrentPage 1
        Call LoadListBox
(lCurrentPage)
    
End If
End Sub

Private Sub Form_Load()
    
    
Set db = New Connection
    db
.CursorLocation adUseClient
    db
.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" AppPath "test.mdb;"

    
lCurrentPage 1
    Call LoadListBox
(lCurrentPage)

End Sub
Private Sub LoadListBox(lPage As Long)
    
Dim adoPrimaryRS As ADODB.Recordset
    Dim lPageCount 
As Long
    Dim nPageSize 
As Integer
    Dim lCount 
As Long

    nPageSize 
7
    Set adoPrimaryRS 
= New Recordset
    adoPrimaryRS
.Open "select * from numbers"dbadOpenStaticadLockOptimistic

    adoPrimaryRS
.PageSize nPageSize
    lPageCount 
adoPrimaryRS.PageCount
    
If lCurrentPage lPageCount Then
        lCurrentPage 
lPageCount
    End 
If
    
    
txtPage.Text lPage
    
    adoPrimaryRS
.AbsolutePage lCurrentPage
    
    With lbxRecords
        
.Clear
        lCount 
0
        
Do While Not adoPrimaryRS.EOF
            
.AddItem adoPrimaryRS("aNumber")
            
lCount lCount 1
            
If lCount nPageSize Then
                
Exit Do
            
End If
            
adoPrimaryRS.MoveNext
        Loop
        
    End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If 
Not db Is Nothing Then
        db
.Close
    End 
If
    
Set db Nothing
End Sub
Public Function AppPath() As String
    
    Dim sAns 
As String
    sAns 
App.Path
    
If Right(App.Path1) <> "\" Then sAns = sAns & "\"
    AppPath = sAns

End Function 

Alıntıdır.


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 10:35.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk