1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
requete = "UPDATE " & cnx.getBase & ".MACHINEFL"
requete = requete & " SET ZPLADEB_0=?" 'Date debut de la tâche ActiveProject.Tasks(i).Start
requete = requete & " ,ZPLAFIN_0=?" 'Date de fin de la tâche ActiveProject.Tasks(i).Finish
requete = requete & " ,ZPLAEXE_0=?" 'Exercice iExercice
If pValide Then
requete = requete & ",ZPLAVALINT_0 = 2"
End If
requete = requete & " WHERE LOT_0=?" 'Lot ActiveProject.Tasks(i).Text2
requete = requete & " AND YNUMLIG_0=?" 'N° de ligne ActiveProject.Tasks(i).Text3
requete = requete & " AND ZPLAVALINT_0 <> 2 "
With cmd
.CommandText = requete
'Date de début
Set pm = .CreateParameter("dateDebut", adDate, adParamInput, 15)
pm.Value = ActiveProject.Tasks(i).Start
.Parameters.Append pm
'Date de fin
Set pm = .CreateParameter("dateFin", adDate, adParamInput, 15)
pm.Value = ActiveProject.Tasks(i).Finish
.Parameters.Append pm
'Exercice
Set pm = .CreateParameter("exercice", adVarChar, adParamInput, 15)
pm.Value = iExercice
.Parameters.Append pm
'Lot
Set pm = .CreateParameter("lot", adVarChar, adParamInput, 15)
pm.Value = ActiveProject.Tasks(i).Text2
.Parameters.Append pm
'N° de ligne
Set pm = .CreateParameter("ligne", adVarChar, adParamInput, 15)
pm.Value = ActiveProject.Tasks(i).Text3
.Parameters.Append pm
End With
'On Error GoTo erreurrequete
cmd.Execute requete, iAffected, adCmdText And adExecuteNoRecords |
Partager