Yeah, i'm using vb 6.0, the list view code is below
Private Sub Init_Data()
On Error GoTo err:
If rs.State = adStateOpen Then rs.Close
Me.lvwInfo.ListItems.Clear
rs.Open "Select * from tblPayroll where Month(dDate)='" & Month(Me.dtPick.Value) & "' And Year(dDate)='" & Year(Me.dtPick.Value) & "' ORDER BY tblPayroll.EM_ID;", cn, adOpenKeyset, adLockPessimistic
Do While rs.EOF = False
Me.lvwInfo.ListItems.Add , , rs.Fields("EM_ID").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1) = rs.Fields("EM_Name").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(2) = rs.Fields("Monthly_Rate").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(3) = rs.Fields("dDate").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(4) = rs.Fields("Bonus").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(5) = rs.Fields("OvertimePay").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(6) = rs.Fields("AwardTicket").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(7) = rs.Fields("FineTicket").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(8) = rs.Fields("pension").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(9) = rs.Fields("w/Tax").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(10) = rs.Fields("OtherDeductions").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(11) = rs.Fields("OtherEarnings").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(12) = rs.Fields("Loans").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(13) = rs.Fields("TotalDeductions").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(14) = rs.Fields("Medical").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(15) = rs.Fields("Housing").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(16) = rs.Fields("Transport").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(17) = rs.Fields("Furniture").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(18) = rs.Fields("Feeding").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(19) = rs.Fields("Miscellaneous").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(20) = rs.Fields("NetPay").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(21) = rs.Fields("RemainingBalance").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(22) = rs.Fields("TotalPaid").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(23) = rs.Fields("LoanCollected").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(24) = rs.Fields("MonthlyDeduction").Value
rs.MoveNext
Loop
Exit Sub
err:
MsgBox err.Description, vbCritical, "Error"
Set rs = Nothing
End Sub