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 562
1 Sergey Alexandrovich Kryukov 484
2 Maciej Los 325
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web02 | 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