I have error message when i run this script
QuerySelect = "SELECT a.DN, b.DIN, c.PIN, " & _
"c.UserName, b.Clock, d.ItemName " & _
"FROM ((ras_Device a INNER JOIN ras_AttRecord b ON a.DN=b.DN) " & _
"LEFT JOIN ras_Users c ON b.DIN=c.DIN) " & _
"LEFT JOIN ras_AttTypeItem d ON b.AttTypeId=d.ItemId " & _
"WHERE b.DIN=c.DIN"
Set rsDataRAS = da_GetRs(QuerySelect)
QuerySelectSIKawan = "SELECT * FROM " _
& "finger_data_karyawan"
Set rsSIKawan = da_GetRecord(QuerySelectSIKawan)
datetimeOut = rsSIKawan!TimeOut >>> debug here
rsSIKawan.Close
rsSQL.CursorLocation = adUseClient
With rsSQL.Fields
.Append "idNo", adInteger
.Append "device", adInteger
.Append "idFinger", adInteger
.Append "nikKary", adVarChar, 50
.Append "namaKary", adVarChar, 100
.Append "time", adDate
.Append "tipeAbsen", adVarChar, 64
End With
rsSQL.Open
If rsDataRAS.RecordCount > 0 Then
jlhField = 0
While Not rsDataRAS.EOF Or rsDataRAS.BOF
rsSQL.AddNew
rsSQL("idNo").Value = jlhField + 1
rsSQL("device").Value = rsDataRAS("DN").Value 'field device
rsSQL("idFinger").Value = rsDataRAS("DIN").Value 'field finger ID
rsSQL("nikKary").Value = rsDataRAS("PIN").Value 'field nik karyawan
rsSQL("namaKary").Value = rsDataRAS("UserName").Value 'field nama karyawan
rsSQL("time").Value = rsDataRAS("Clock").Value 'field waktu
rsSQL("tipeAbsen").Value = rsDataRAS("ItemName").Value 'field tipe waktu
rsSQL.Update
rsDataRAS.MoveNext
jlhField = jlhField + 1
If datetimeOut = "" _
Then
QueryUpdateSIKawan = "UPDATE finger_data_karyawan SET " _
& "TimeOut='" & Format(rsSQL("time").Value, "mm/dd/yyyy hh:nn:ss") & "'" _
& "WHERE Device='" & rsSQL("device").Value & "' AND " _
& "idFinger='" & rsSQL("idFInger").Value & "' AND " _
& "NIKKary='" & rsSQL("nikKary").Value & "' AND " _
& "NamaKary='" & rsSQL("namaKary").Value & "' AND " _
& "TglHadir='" & Format(rsSQL("time").Value, "mm/dd/yyyy") & "'" _
& "AND TimeIn='" & Format(rsSQL("time").Value, "" _
& "mm/dd/yyyy h:mm:ss") & "' AND TipeAbsen = " _
& "'" & rsSQL("idFInger").Value & "'"
Call ExeQUERY(QueryUpdateSIKawan)
Else
QueryInsertSIKawan = "INSERT INTO finger_data_karyawan " _
& "(idNo, Device, idFinger, NIKKary, NamaKary, " _
& "TglHadir, TimeIn, TipeAbsen) " _
& "VALUES('" & rsSQL("idNo").Value & "', '" & rsSQL("device").Value & "', " _
& "'" & rsSQL("idFinger").Value & "', '" & rsSQL("nikKary").Value & "', " _
& "'" & rsSQL("namaKary").Value & "', " _
& "'" & Format(rsSQL("time").Value, "mm/dd/yyyy") & "', " _
& "'" & Format(rsSQL("time").Value, "mm/dd/yyyy h:mm:ss") & "', " _
& "'" & rsSQL("tipeAbsen").Value & "')"
Call ExeQUERY(QueryInsertSIKawan)
End If
DoEvents
Wend
End If
Can anyone help me?
Regards,
Octo