[..] Requête SQL dans script AutoIt
Posté : ven. 11 déc. 2009 13:59
Bonjour,
Dans un script AutoIt, je dois lancer une requête SQL sur une base informix distante. J'ai une erreur au lancement de la requête. Voici le code écrit :
La variable $entrep_en a bien été déclarée.
J'ai l'erreur suivante :
ES-ce le code de ma requête qui comporte une anomalie ?
J'avoue que je séche. Pouvez-vous l'apporter une aide.
Merci.
Cordialement
Dans un script AutoIt, je dois lancer une requête SQL sur une base informix distante. J'ai une erreur au lancement de la requête. Voici le code écrit :
Code : Tout sélectionner
LECTURE DU FICHIER .INI
$dsn = IniRead($cfg_file, "infocentre", "dsn", "")
$host = IniRead($cfg_file, "infocentre", "host", "")
$server = IniRead($cfg_file, "infocentre", "server", "")
$service = IniRead($cfg_file, "infocentre", "service", "")
$protocol = IniRead($cfg_file, "infocentre", "protocol", "")
$database = IniRead($cfg_file, "infocentre", "database", "")
$uid = IniRead($cfg_file, "infocentre", "uid", "")
$pwd = IniRead($cfg_file, "infocentre", "pwd", "")
$objConn = ObjCreate("ADODB.Connection")
$objConn.Open("Dsn=" & $dsn & ";Host=" & $host & ";Server=" & $server & ";Service=" & $service & ";Protocol=" & $protocol & ";Database=" & $database & ";Uid=" & $uid & ";Pwd=" & $pwd)
$rsCustomers = $objConn.Execute("select distinct s_grp_trv_3.nide,s_grp_trv_3.nprt from s_grp_trv s_grp_trv_3 where (s_grp_trv_3.nide ='" & $entrep_en & "') and ((s_grp_trv_3.nprt LIKE "'GPE%'")or(s_grp_trv_3.nprt LIKE "'RE%'")or(s_grp_trv_3.nprt LIKE "'S%'")"))J'ai l'erreur suivante :
Code : Tout sélectionner
---------------------------
AutoIt Error
---------------------------
Line 156 (File "D:\AutoIt\sadf\sadf.au3"):
$rsCustomers = $objConn.Execute("select distinct s_grp_trv_3.nide,s_grp_trv_3.nprt from s_grp_trv s_grp_trv_3 where (s_grp_trv_3.nide ='" & $entrep_en & "') and (s_grp_trv_3.nprt LIKE "'GPE%'")or(s_grp_trv_3.nprt LIKE "'RE%'")or(s_grp_trv_3.nprt LIKE "'S%'")")
$rsCustomers = $objConn.Execute(^ ERROR
Error: Error in expression.
---------------------------
OK
---------------------------J'avoue que je séche. Pouvez-vous l'apporter une aide.
Merci.
Cordialement