Hi please pay attention to:
Collapse | Copy Code
Private Sub Command1_Click()
CN.Open "Driver=sql server;server=SOFT2;DataBase=Timetronix;"
MsgBox "connect to the database"
REC.Open "Select * from CHECKINOUT where CHECKTIME BETWEEN '" & DTPicker1.Value & "' AND '" & DTPicker2.Value & "'", CN, adOpenStatic, adLockReadOnly
If REC.RecordCount > 0 Then
For i = 1 To REC.RecordCount
LstLog.ListItems.Add , , REC("SensorID")
LstLog.ListItems(i).SubItems(1) = REC("CheckTime")
LstLog.ListItems(i).SubItems(2) = IIf(IsNull(REC("EMPID")), "", REC("EMPID"))
MsgBox "hello " & LstLog.ListItems(i)
REC.MoveNext
Next
REC.Close
CN.Close
End If
End Sub
and if you want getting information about message box in vb6 you can follow of links:
http://visualbasic.freetutes.com/learn-vb6/lesson18.html[
^]
http://www.vb6.us/tutorials/understanding-msgbox-command-visual-basic[
^]
Best Regards.