#include #include #include #include #include #include AutoItSetOption("MustDeclareVars", 1) Global $PATH_SQLITE3_DLL = @ScriptDir & "\sqlite3.dll" Global $PATH_BDD = @ScriptDir & "\bdd" Call("main", $CmdLine[0]) Func main($argc) Global $h_bdd Global $table_name Global $gui,$inp_search,$but_search local $msg,$Query,$Row,$table_name global $result if not FileExists($PATH_BDD) then exit msgbox(16,"Erreur","Je n'ai pas trouvé le fichier bdd !") If FileExists($PATH_SQLITE3_DLL) Then _SQLite_Startup($PATH_SQLITE3_DLL) Else _SQLite_Startup() EndIf $h_bdd = _SQLite_Open($PATH_BDD) if @error then exit msgbox(16,"Erreur","Probléme dans l'ouverture du fichier bdd") $table_name = inputbox("?","Nom de la table ? (indiquer dans le fichier fil.log apres avoir lancé fil.au3)") if @error then exit Msgbox(16,"Erreur","Saisie incorrect") create_gui() GUISetState() while 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE exitloop Case $but_search _SQlite_Query ($h_bdd, "SELECT * FROM "&$table_name& " WHERE `nom` LIKE '"&GUICtrlRead($inp_search) & "%' LIMIT 0,20;", $Query) while (_SQLite_FetchData ($Query, $Row) == $SQLITE_OK) _ArrayDisplay($Row) WEnd EndSwitch WEnd _SQLite_Shutdown() Exit (0) EndFunc ;==>main func create_gui() Dim $but_search,$gui,$inp_search $gui = GUICreate("Ariane", 250, 40, 40, 40, -1, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) $inp_search = GUICtrlCreateInput("", 0, 0, 250 , 20, $ES_CENTER) $but_search = GUICtrlCreateButton("Chercher", 0, 20 , 250 , 20 ) endfunc