#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <File.au3>
_SQLite_Startup('sqlite3.dll')
If @error Then
MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded!")
Exit -1
EndIf
_SQLite_Open('mydat.dat') ; open :memory: Database
;#cs
_SQLite_Exec(-1, "CREATE TABLE Table1 (A,B,C);")
_SQLite_Exec(-1, "INSERT INTO Table1(a,b,c) VALUES ('c','2','World');")
_SQLite_Exec(-1, "INSERT INTO Table1(a,b,c) VALUES ('b','3',' ');")
_SQLite_Exec(-1, "INSERT INTO Table1(a,b,c) VALUES ('a','1','Hello');")
;_SQLite_Query(-1, "SELECT ROWID,* FROM Table1 ORDER BY a;", $hQuery)
_SQLite_Exec(-1, "CREATE TABLE Table2 (A,B,C);")
_SQLite_Exec(-1, "INSERT INTO Table2(a,b,c) VALUES ('c','2','World');")
_SQLite_Exec(-1, "INSERT INTO Table2(a,b,c) VALUES ('b','3',' ');")
_SQLite_Exec(-1, "INSERT INTO Table2(a,b,c) VALUES ('a','1','Hello');")
;#ce
Local $hQuery, $aRow, $sNames = ''
_SQLite_Query(-1, "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;", $hQuery)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK ;能读到有效数据
$sNames &= $aRow[0] & @CRLF ; 注意, 读到数据时, 必定储存于 $aRow 这个数组里
WEnd
MsgBox(0, '所有表名', $sNames)
_SQLite_Close()
_SQLite_Shutdown()