
B-75074EN/04 USER CUSTOMIZE 4.REFERENCING THE DATABASE
- 463 -
SetDspLastState_WkPc :: DB_LastState
This procedure sets total machining count data in the machining end
state display table.
The following SQL statement is created:
tSQL = "INSERT INTO WKPCDspLastState" & _
" (" & m_FieldText & _
", ProcNum)" & _
" VALUES" & _
" ('" & m_CntWkPc(i).ID & "'" & _
", '" & m_CntWkPc(i).Count & "')"
By using the INSERT INTO command, this SQL statement newly
writes acquired total machining count to the machining end state
display table.
SetDspLastState_WkPcPlan :: DB_LastState
This procedure sets planned count data in the machining end state
display table.
Whether there is a record with the same condition is checked using the
CheckSameRecord procedure. If there is a record with the same
condition, the record is updated. If there is no record with the same
condition, a new record is written.
The following SQL statement is created:
When there is a record with the same condition
tSQL = "UPDATE WKPCDspLastState w" & _
" SET w.PlanNum='" & m_CntWkPcPlan(i).Count & "'" & _
" WHERE w." & m_FieldText & "=" &
m_CntWkPcPlan(i).ID
By using the UPDATE command, this SQL statement writes planned
count to PlanNum.
When there is no record with the same condition
tSQL = "INSERT INTO WKPCDspLastState" & _
" (" & m_FieldText & _
", PlanNum) " & _
" VALUES" & _
" ('" & m_CntWkPcPlan(i).ID & "'" & _
", '" & m_CntWkPcPlan(i).Count & "')"
By using the INSERT INTO command, this SQL statement newly
writes acquired planned count to the machining end state display table.