• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Listview Hakkında

Katılım
18 Ekim 2005
Mesajlar
65
Excel Vers. ve Dili
Ofis 2000 İngilizce
Merhaba,

Vb 6.0 da bir projem var ve bir noktada takıldım kaldım. Aslında düzgün çalışıyor ve kayıtları getiriyor ama boş olan satırları bir türlü silemiyorum yardımcı olabilirmisiniz. Kodları gönderiyorum.

Bir döngü ile veya başka bir şekilde boş satırların silinmesini istiyorum.

Saygılarımla.



Private Sub Command1_Click()
On Local Error Resume Next
Dim Conn As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim Dal As ListItem


Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=O:\programlar\operasyon.mdb"

Conn.Open

ListView1.ListItems.Clear


RS.Open "Select * from murat", Conn, adOpenKeyset, adLockOptimistic


Do Until RS.EOF

Set Dal = ListView1.ListItems.Add(, "No" & RS(0), RS(0))


ListView.AddItem RS![FİRMA İSMİ] & "|" & RS![PAZARLAMACI] & "|" & "|" & RS![İŞLEM TUTARI] & "|" & RS![NET ÖDENEN] & "|" & RS![FAİZ ORANI]


aa = RS![İŞLEM TARİHİ]


If aa >= DTPicker1 And aa <= DTPicker2 Then



If Not IsNull(RS(1)) Then Dal.SubItems(1) = RS(1)
If Not IsNull(RS(2)) Then Dal.SubItems(2) = RS(2)
If Not IsNull(RS(3)) Then Dal.SubItems(3) = RS(3)
If Not IsNull(RS(4)) Then Dal.SubItems(4) = RS(4)
If Not IsNull(RS(5)) Then Dal.SubItems(5) = RS(5)
If Not IsNull(RS(6)) Then Dal.SubItems(6) = RS(6)
If Not IsNull(RS(7)) Then Dal.SubItems(7) = RS(7)
If Not IsNull(RS(8)) Then Dal.SubItems(8) = RS(8)
If Not IsNull(RS(9)) Then Dal.SubItems(9) = RS(9)
If Not IsNull(RS(10)) Then Dal.SubItems(10) = RS(10)
If Not IsNull(RS(11)) Then Dal.SubItems(11) = RS(11)
If Not IsNull(RS(12)) Then Dal.SubItems(12) = RS(12)
If Not IsNull(RS(13)) Then Dal.SubItems(13) = RS(13)
If Not IsNull(RS(14)) Then Dal.SubItems(14) = RS(14)
If Not IsNull(RS(15)) Then Dal.SubItems(15) = RS(15)
If Not IsNull(RS(16)) Then Dal.SubItems(16) = RS(16)
If Not IsNull(RS(17)) Then Dal.SubItems(17) = RS(17)
If Not IsNull(RS(18)) Then Dal.SubItems(18) = RS(18)

End If

RS.MoveNext

Loop



RS.Close

En Sub
 
böyle denermisiniz eklediğim yeri döngüye aldım kırmızı renkle belirttim kendire göre hangi sutünu taratacaksanız o sutunun adın vermeniz gerekiyor

Private Sub Command1_Click()
On Local Error Resume Next
Dim Conn As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim Dal As ListItem
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=O:\programlar\operasyon.mdb"
Conn.Open
ListView1.ListItems.Clear
RS.Open "Select * from murat", Conn, adOpenKeyset, adLockOptimistic
Do Until RS.EOF
Set Dal = ListView1.ListItems.Add(, "No" & RS(0), RS(0))
ListView.AddItem RS![FİRMA İSMİ] & "|" & RS![PAZARLAMACI] & "|" & "|" & RS![İŞLEM TUTARI] & "|" & RS![NET ÖDENEN] & "|" & RS![FAİZ ORANI]
aa = RS![İŞLEM TARİHİ]
If aa >= DTPicker1 And aa <= DTPicker2 Then
For i = 1 To 18
If Not IsNull(RS(i)) Then
If RS(1) <> "" Then
x = x + 1
Dal.SubItems(x) = RS(i)
End If
End If
Next
End If
RS.MoveNext
Loop
RS.Close
End Sub
 
Halit Bey merhaba,

İlginize teşekkürler. Son End If e hata veriyor bir şey noksan herhalde.

Saygılar.
 
next yok onu eklemeyi unutmuşum.
 
Halit Bey,
Bu seferde sadece ilk kayıdı getirdi ve boş satırlarda geliyor normalde 28.07 ye ait 36 kayıt getirmesi lazım.
 
Halit Bey Merhaba,

Kayıtları okuyor ama yazmıyor sadece ilk kayıdı yazıyor.
 
sana bir dosya gönderiyorum. sayfa1de listview1 düğmesine tikla boş satırları ve tamamınıda ayrı olarak listeliyor ancak her iki dosyada aynı yerde olacak bunlara bir incele
 

Ekli dosyalar

Geri
Üst