Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

listview shows total time database table dosnt

$
0
0
very strange thing ..
when i load my program i see in the listview the total time in the system
when i go to the database manualy (at the same table) i dont see nothing in the total why?
this is my code:when i load the program
Code:

Private Sub Loadiaarry()
  Set rs = CN.Execute("SELECT * FROM Logs ORDER BY LogId")
    While Not rs.EOF
        Set itm = FrmSecurityreport.LsVw.ListItems.Add(, , rs!LogId, , "report")
        itm.Tag = rs!LogId
        itm.Bold = True
        itm.SubItems(1) = rs!LogDate
        itm.SubItems(2) = rs!LogDay
        itm.SubItems(3) = rs!LogName
        itm.SubItems(4) = rs!LogIn
        Dim daDate1 As Date
Dim daDate2 As Date
Dim intMins As Integer
Dim intHrs As Integer
If Not IsNull(rs![logout]) Then
itm.SubItems(5) = rs![logout]
If IsNull(rs![LogTotal]) Then
        daDate1 = CDate(itm.SubItems(4))
        daDate2 = CDate(itm.SubItems(5))
        intMins = DateDiff("n", daDate1, daDate2)
        intHrs = intMins \ 60
        intMins = intMins Mod 60
        itm.SubItems(6) = CStr(intHrs) & ":" & CStr(intMins)
    Else
        itm.SubItems(6) = rs![LogTotal]
    End If
End If
        rs.MoveNext
        DoEvents
  Wend
    End Sub

this is when i exit the program
Code:

          CN.Execute "UPDATE Logs SET LogOUT= #" & Format(Now, "HH:MM:SS") & "# WHERE LogID= " & ULog

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>