1.11M Members

Listview

 
0
 

can someone help me ? whenever i start this program its always says that
" compile error
type-declaration characters does not match declared data type.
then the rs.Fields! will go hightlight.
can someone help me ?

    Dim rs As Recordset
Private Sub Form_Load()
Dim list As ListItem
ListView1.ListItems.Clear
Set rs = New Recordset

    getconnected

    rs.Open "Select * From Barrowers", cnn, adOpenDynamic, adLockOptimistic

  Do While Not rs.EOF = True

Set list = ListView1.ListItems.Add(, , rs("Barrowers"))
list.ListItems(list.ListItems.Count).SubItems(1) = rs.Fields!("BarrowersID")
list.ListItems(list.ListItems.Count).SubItems(2) = rs.Fields!("BarrowersName")
list.ListItems(list.ListItems.Count).SubItems(3) = rs.Fields!("BarrowersType")
list.ListItems(list.ListItems.Count).SubItems(4) = rs.Fields!("BarrowersContact")
list.ListItems(list.ListItems.Count).SubItems(5) = rs.Fields!("BarrowersStatus")
rs.MoveNext
Loop
end Sub
 
0
 

First off that code looks like VB6 not VB.net.

Try setting the value of the subitems instead of the whole object.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: