Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6
Am trying to create a form that displays userlog. below is my sub routine; DisplayUserLog. Am getting the following error at runtime: Run-time error '-2147217900 (80040e14)': incorrect syntax...
 
Sub DisplayUserLog(lstLog As ListView, mDate As Date)
Dim lstItem As ListItem, a As Integer
If Rs.State = adStateOpen Then Rs.Close
   sql = " Select * From Userlog Where (Userlog.Date)=#" & mDate & "#"
   Rs.Open sql, RSconn
   lstLog.ListItems.Clear
   Do While Not Rs.EOF
    a = a + 1
        Set lstItem = lstLog.ListItems.Add(, , a)
            lstItem.SubItems(1) = Rs(1).Value
            lstItem.SubItems(2) = Rs(2).Value
             If IsNull(Rs(3).Value) Then
                lstItem.SubItems(3) = ""
             Else
                lstItem.SubItems(3) = Rs(3).Value
             End If
            lstItem.SubItems(4) = Rs(4).Value
            Rs.MoveNext
            Loop
End Sub
Posted 12-Apr-13 21:57pm
Edited 12-Apr-13 22:31pm
v4
Comments
du[DE] at 13-Apr-13 3:02am
   
Set lstItem = lstLog.ListItems.Add(, , a) looks strange
Aleu Philip at 13-Apr-13 3:12am
   
a way of adding new values to the list at runtime

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 299
2 BillWoodruff 174
3 /\jmot 170
4 Suraj Sahoo | Coding Passion 150
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 13 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100