Microsoft Windows Common Controls 6.0(SP6)
c:\windows\system32\mscomctl.ocx
Hi,
I am using the listview from the component category Microsoft Windows Common Controls 6.0(SP6), the ocx is mscomctl.ocx.
I had no problem during the design time. After I compiled my code into .EXE, it will shows the following error message.
Run-tme error '35600'"
Index out of bounds.
Following are my coding:
Private Sub Form_Load()
Me.Show
Dim Con
Dim RS
SQL = "SELECT * FROM Customer"
Set Con = CreateObject("ADODB.Connection")
Con.Open frmLogin.ConString
Set RS = CreateObject("ADODB.Recordset")
RS.Open SQL, Con
Dim i As Integer
i = 0
While Not RS.EOF
i = i + 1
lvCustomer.ListItems(i).Text = lvCustomer.ListItems.Add(, , RS(0))
lvCustomer.ListItems(i).SubItems(1) = RS(1)
lvCustomer.ListItems(i).SubItems(2) = RS(2)
RS.MoveNext
Wend
RS.Close
Con.Close
End Sub
The lvCustomer is my listview name.
I preset the view to 3-lvwReport and the columns in the property pages. My OS is Windows XP2 with SP 2
Thanks in advance.
c:\windows\system32\mscomctl.ocx
Hi,
I am using the listview from the component category Microsoft Windows Common Controls 6.0(SP6), the ocx is mscomctl.ocx.
I had no problem during the design time. After I compiled my code into .EXE, it will shows the following error message.
Run-tme error '35600'"
Index out of bounds.
Following are my coding:
Private Sub Form_Load()
Me.Show
Dim Con
Dim RS
SQL = "SELECT * FROM Customer"
Set Con = CreateObject("ADODB.Connection")
Con.Open frmLogin.ConString
Set RS = CreateObject("ADODB.Recordset")
RS.Open SQL, Con
Dim i As Integer
i = 0
While Not RS.EOF
i = i + 1
lvCustomer.ListItems(i).Text = lvCustomer.ListItems.Add(, , RS(0))
lvCustomer.ListItems(i).SubItems(1) = RS(1)
lvCustomer.ListItems(i).SubItems(2) = RS(2)
RS.MoveNext
Wend
RS.Close
Con.Close
End Sub
The lvCustomer is my listview name.
I preset the view to 3-lvwReport and the columns in the property pages. My OS is Windows XP2 with SP 2
Thanks in advance.