You are going to find it difficult to get any help with VB6 code as very few, if any, still use it.
Some feedback... You have too much code in the
cmdGlogData_Click
event. Break it up into single responsibility chunks. This will help greatly with reading your code... Something like...
Private Sub cmdGlogData_Click()
InitializeGrid(gridSLogData)
If InitializeDeviced() Then
GetDeviceDataAndSave(gridSLogData)
Else
lblMessage.Caption = gstrNoDevice
MousePointer = vbDefault
End If
end Sub
Private Sub InitializeGrid(gridLog as GridView)
End Sub
Private Function InitializeDevice(mMachineNumber as long) as Boolean
dim success as Boolean
success = frm_DataImp.FP_CLOCK1.EnableDevice(mMachineNumber, False)
return success
End Sub
Private Sub GetDeviceDataAndSave(mMachineNumber as long, gridLog as GridView)
Dim vTMachineNumber As Long
Dim vSMachineNumber As Long
Dim vSEnrollNumber As Long
Dim vVerifyMode As Long
Dim vYear As Long
Dim vMonth As Long
Dim vDay As Long
Dim vHour As Long
Dim vMinute As Long
If frm_DataImp.FP_CLOCK1.GetAllGLogData(mMachineNumber, _
vTMachineNumber, _
vSEnrollNumber, _
vSMachineNumber, _
vVerifyMode, _
vYear, vMonth, vDay, _
vHour, vMinute) Then
If SaveDataEntry(mMachineNumber, _
vTMachineNumber, _
vSEnrollNumber, _
vSMachineNumber, _
vVerifyMode, _
vYear, vMonth, vDay, _
vHour, vMinute) Then
LogEntry(gridLog, mMachineNumber, _
vTMachineNumber, _
vSEnrollNumber, _
vSMachineNumber, _
vVerifyMode, _
vYear, vMonth, vDay, _
vHour, vMinute)
Else
End If
Else
End If
End Sub
Private Function SaveDataEntry(vTMachineNumber As Long, vSMachineNumber As Long _
vSEnrollNumber As Long, vVerifyMode As Long, _
vYear As Long, vMonth As Long, vDay As Long, _
vHour As Long, vMinute As Long) as Boolean
dim success as Boolean
return success
End Function
NOTE: This is only a mock-up of how you could possibly structure the code...
Now you can see each part of the process and monitor each write to the database as it is encapsulated in its own function. Debugging your code has now become a lot easier...