Je bute un peu sur une requête toute bête dont je n'arrive pas à collecter le résultat ... j'ai bien vérifié que ma connexion fonctionnait, je récupère bien la liste des tables, mais ma requête ne renvoit rien (ou alors je ne suis pas capable d'interpréter le résultat renvoyé).
Code : Tout sélectionner
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include<_sql.au3>
#include<array.au3>
Local $aData,$iRows,$iColumns
;Server ID and credentials for tCards
Global $ServerAddressT = "10.200.88.1"
Global $ServerUserNameT = "user"
Global $ServerPasswordT = "password"
Global $DatabaseNameT = "DataBASE"
;Connect to DB
_SQL_RegisterErrorHandler();register the error handler to prevent hard crash on COM error
$OADODB = _SQL_Startup()
If $OADODB = $SQL_ERROR Then MsgBox(0 + 16 + 262144, "Error", _SQL_GetErrMsg())
If _sql_Connect(-1, $ServerAddressT, $DatabaseNameT, $ServerUserNameT, $ServerPasswordT) = $SQL_ERROR Then
MsgBox(0 + 16 + 262144, "Error 1", _SQL_GetErrMsg())
_SQL_Close()
Exit
Else
If _SQL_Execute(-1,"select @@SERVERNAME") = $SQL_ERROR then
Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg())
Else
_ArrayDisplay(_SQL_GetTable(-1,"select @@SERVERNAME",$aData,$iRows,$iColumns))
;~ $toto = _SQL_Execute(-1,"select @@SERVERNAME")
;~ _ArrayDisplay($toto)
EndIf
EndIf
Send