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

Edited by anJelo.towT

2
Contributors
1
Reply
16
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

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

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

Edited by tinstaafl

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.