Impossibilité de lancer une requête SQL
hilario33
-
joomliner Messages postés 93 Statut Membre -
joomliner Messages postés 93 Statut Membre -
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 :
Code
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%'")"))
La variable $entrep_en a bien été déclarée.
J'ai l'erreur suivante :
---------------------------
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
---------------------------
ES-ce le code de ma requête qui comporte une anomalie ?
J'avoue que je séche. Pouvez-vous m'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
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%'")"))
La variable $entrep_en a bien été déclarée.
J'ai l'erreur suivante :
---------------------------
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
---------------------------
ES-ce le code de ma requête qui comporte une anomalie ?
J'avoue que je séche. Pouvez-vous m'apporter une aide.
Merci.
Cordialement
A voir également:
- Impossibilité de lancer une requête SQL
- Lancer une application au démarrage windows 10 - Guide
- Qu'est ce qui se lance au démarrage de l'ordinateur - Guide
- Logiciel sql - Télécharger - Bases de données
- Comment lancer gemini - Accueil - Téléphones
- Fichier batch pour lancer un programme - Guide