Bonjour, j'ai besoin d'un petit peu d'aide:
j'ai mis en place un script specifique ( tutoriel Domotics) pour logger la valeur d'un device dans ma base mysql ,en laissant la configuration des fichiers:
- Startup.txt avec hs.RegisterStatusChangeCB "lib\framework_domotics.vbs", "traceDeviceChanges""
- framework_domotics.inc avec les infos qui marchent pour G_CONNECTION_STRING et en ne mettant rien dans G_DEV_WHICH_MUST_BE_LOGGED
car je pense que c'est le Script specifique :
#include ..\lib\framework_domotics.vbs
Sub main
'Sub saveDeviceChangeWithAuthor(astrDevice,astrAuthor)
Dim aobjConn ' Connection to the database
Dim astrConnectionString ' Connection String
Dim astrDatabase ' Path + File to find the database
Dim astrSQL ' Query to be executed
Dim aevtLast ' Last event trigered
Dim acodeLast ' Last code changed
Dim aDateTime ' Current Date and Time
Dim astrDevice
astrDevice="A1"
Set aobjConn = CreateObject("ADODB.Connection")
aobjConn.Open(G_CONNECTION_STRING)
aDateTime = Now()
astrSQL = "INSERT INTO EVENTS (STRING, DEVICE, STATUS, VALUE, DATE, NOTES) VALUES ("
astrSQL = astrSQL & "'" & replace(hs.DeviceString(aStrDevice),"'","''") & "',"
astrSQL = astrSQL & "'" & astrDevice & "',"
astrSQL = astrSQL & "'" & hs.DeviceStatus(astrDevice) & "',"
astrSQL = astrSQL & hs.DeviceValue(astrDevice) & ","
astrSQL = astrSQL & "'" & Year(aDateTime) &"/"& Month(aDateTime) &"/"& Day(aDateTime)
astrSQL = astrSQL & " " & Hour(aDateTime) &":"& Minute(aDateTime) &":"& Second(aDateTime) & "',"
astrSQL = astrSQL & "'" & replace(astrAuthor,"'","''") & "')"
aobjConn.Execute astrSQL
aobjConn.Close
Set aobjConn = Nothing
End Sub
qui récupère la valeur du Device A1
puis je fais un SQL : select device, date from events
mais je recois l'erreur :
Running script, script run or compile error in file: test.vbs-2147467259:[Microsoft][Gestionnaire de pilotes ODBC] Source de données introuvable et nom de pilote non spécifié in line 13 More info: [Microsoft][Gestionnaire de pilotes ODBC] Source de données introuvable et nom de pilote non spécifié
Je ne vois pas ce qui est incorrect ?
Quand j'utilise uniquement le framework et en mettant un "type" dans G_DEV_WHICH_MUST_BE_LOGGED
ca logge parfaitement mais .....trop
Merci de votre aide

