La DLL peut se trouver à plusieurs endroits, par exemple le dossier de lancement de l'exe, les dossiers système de l'OS ou bien encore selon une variable d'environnement. Voir la doc officielle sur ce point (sqlite.org).
Si l'exe est un x86 (32 bits) la dll recherchée est sqlite3.dll à défaut d'être explicitement spécifiée en argument de *_startup.
Si l'exe est un x64 (64 bits) *_startup recherche par défaut sqlite3_x64.dll ; si une dll est explicite en argument et si elle ne contient pas la chaîne '_x64' alors celle chaîne est ajoutée avant l'extension.
Exemple en x64 :
Code : Tout sélectionner
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Run_AU3Check=n
#include <SQLite.au3>
Const $SQLITE_DLL = "C:\SQLite\bin\sqlite3_x64.dll" ;<-- Change to the location of your sqlite dll
Local $aRow
;Init sqlite and create a memory db
_SQLite_Startup($SQLITE_DLL, False, 1)
If @error Then Exit MsgBox($MB_ICONERROR, "SQLite Error", "Unable to start SQLite. Check existence of DLL")
_SQLite_Open()
Local $s = "CREATE TABLE if not exists t1 (a INTEGER PRIMARY KEY, b char, c char);" & _
"INSERT INTO t1 VALUES (4, 'D', 'one'), (2, 'B', 'two'), (6, 'F', 'three'), (5, 'E', 'two'), (3, 'C', 'three'), (1, 'A', 'one'), (7, 'G', 'one');"
_SQLite_Exec(-1, $s)
$s = "SELECT a, b, group_concat(b, '->') OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS Sequence FROM t1;"
Local $aRows, $iRows, $iCols
_SQLite_GetTable2d(-1, $s, $aRows, $iRows, $iCols)
_SQLite_Display2DResult($aRows)
_SQLite_Shutdown()
La même chose en X86 :
Code : Tout sélectionner
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Run_AU3Check=n
#include <SQLite.au3>
Const $SQLITE_DLL = "C:\SQLite\bin\sqlite3.dll" ;<-- Change to the location of your sqlite dll
Local $aRow
;Init sqlite and create a memory db
_SQLite_Startup($SQLITE_DLL, False, 1)
If @error Then Exit MsgBox($MB_ICONERROR, "SQLite Error", "Unable to start SQLite. Check existence of DLL")
_SQLite_Open()
Local $s = "CREATE TABLE if not exists t1 (a INTEGER PRIMARY KEY, b char, c char);" & _
"INSERT INTO t1 VALUES (4, 'D', 'one'), (2, 'B', 'two'), (6, 'F', 'three'), (5, 'E', 'two'), (3, 'C', 'three'), (1, 'A', 'one'), (7, 'G', 'one');"
_SQLite_Exec(-1, $s)
$s = "SELECT a, b, group_concat(b, '->') OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS Sequence FROM t1;"
Local $aRows, $iRows, $iCols
_SQLite_GetTable2d(-1, $s, $aRows, $iRows, $iCols)
_SQLite_Display2DResult($aRows)
_SQLite_Shutdown()