1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Public Function enregistreReparationMateriel(raison, centre, codeArticle, numDDSIS, marque, numSerie As String) As Boolean
Dim req As String
If UCase(raison) = "VERIFICATION PREVENTIVE" Then
raison = "Vérification préventive"
End If
If UCase(raison) = "PANNE" Then
raison = "Panne"
End If
On Error GoTo err
req = "insert into " & lireIni("depot", "fichier") & " (raison,centre_de_secours,code_article,n_ddsis,marque,`N°série`) values (" & Chr(34) & raison & Chr(34) & "," & Chr(34) & centre & Chr(34) & "," & Chr(34) & codeArticle & Chr(34) & "," & Chr(34) & numDDSIS & Chr(34) & "," & Chr(34) & marque & Chr(34) & "," & Chr(34) & numSerie & Chr(34) & ")"
cmdTmp.ActiveConnection = cnx
cmdTmp.CommandText = req
cnx.BeginTrans
cmdTmp.Execute
cnx.CommitTrans
enregistreReparationMateriel = True
Exit Function
err:
cnx.RollbackTrans
MsgBox err.Description
enregistreReparationMateriel = False
End Function |
Partager