cs_Dante27
Messages postés19Date d'inscriptionmardi 3 janvier 2006StatutMembreDernière intervention29 février 2008
-
23 janv. 2008 à 16:19
cs_Exploreur
Messages postés4821Date d'inscriptionlundi 11 novembre 2002StatutMembreDernière intervention15 novembre 2016
-
23 janv. 2008 à 17:41
Bonjours à tous,
Je vous expose mon problème. J'ai crée une fonction qui doit me permettre de récupérer des valeurs et ensuite de les enregistrer dans la base.Voici son code:
'Récupère les logs afin de les rentrer dans la base de données
Public Sub GetEventLog(pDataDescId As Long, pProductionId As Long, pLogCategory As String, pLogUser As String, pLogValue As String)
Dim pLogDateTime As Date
pLogDateTime = DateTime.Now
If SQLQIConnect(MSSQLServer, DB, UserName, PW) Then
ADOCommandQI.CommandText = "INSERT INTO JnJ_QI_EventLog(LogId,DataDescId" & _
",ProductionId,LogCategory,LogUser,LogDateTime,LogValue) VALUES('',pDataDescid" & _
",pProductionId,pLogCategory, pLogUser,pLogDateTime,pLogValue)"
ADOCommandQI.Execute
Else
ADOConnectionQI.Open
ADOCommandQI.ActiveConnection = ADOConnectionQI
ADOCommandQI.CommandText = "INSERT INTO JnJ_QI_EventLog(LogId,DataDescId" & _
",ProductionId,LogCategory,LogUser,LogDateTime,LogValue) VALUES('',pDataDescid" & _
",pProductionId,pLogCategory, pLogUser,pLogDateTime,pLogValue)"
ADOCommandQI.Execute
ADOConnectionQI.Close
End If
Exit Sub
End Sub
Lorsque je veux utiliser ma fonction en lui passant bien les bons paramètres , j'ai un message d'erreur m'indiquant qu'après ma fonction est attendu un =; et je ne comprends pas vraiment pourquoi.
cs_Dante27
Messages postés19Date d'inscriptionmardi 3 janvier 2006StatutMembreDernière intervention29 février 2008 23 janv. 2008 à 16:38
L'erreur se produit dans le form au niveau du click de mon bouton valider
Private Sub Command2_Click()
Dim DataDescId As Long
DataDescId = Val(Text1.Text)
Dim ProductionId As Long
ProductionId = Val(Text2.Text)
Dim LogCategory As String
LogCategory = Text3.Text
Dim LogUser As String
LogUser = Text4.Text
Dim LogValue As String
LogValue = Text5.Text
GetEventLog(DataDescId,ProductionId,LogCategory,LogUser,LogValue)
End Sub
A la fin du GetEventLog, l'IDE me dit "Erreur de compilation Attendu: ="