; *** Start added by AutoIt3Wrapper ***
#include <StaticConstants.au3>
; *** End added by AutoIt3Wrapper ***
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <MsgBoxConstants.au3>
#include <SQLite.dll.au3>
#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <GuiListView.au3>
Local $aResult, $iRows, $iColumns, $iRval, $iPercent
MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite.dll Can't be Loaded!")
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
_SQLite_Open() ; Open a :memory: database
MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't Load Database!")
If Not _SQLite_Exec(-1, "CREATE TEMP TABLE persons (Name, Age);") = $SQLITE_OK Then _
MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg())
For $i = 1 To 1000 ;datensätze * 1000
If Not _SQLite_Exec(-1, "INSERT INTO persons VALUES ('Alice','43');") = $SQLITE_OK Then _
MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg())
If Not _SQLite_Exec(-1, "INSERT INTO persons VALUES ('Bob','28');") = $SQLITE_OK Then _
MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg())
If Not _SQLite_Exec(-1, "INSERT INTO persons VALUES ('Cindy','21');") = $SQLITE_OK Then _
MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg())
GUICreate("SQLite with LV", 400, 300)
$idListview = GUICtrlCreateListView("Name|Age", 2, 2, 394, 268)
; Alternate between the listview background color and the listview item background color.
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE)
; Set the background color for the listview.
; Odd listview items will be shown with the background color of the listview,
; even with the background color of the listview item.
GUICtrlSetBkColor(-1, $COLOR_AQUA)
$idPercent = GUICtrlCreateLabel('0 %', 2, 272, 35, 25, $SS_CENTERIMAGE)
$idProgress = GUICtrlCreateProgress(42, 272, 355, 25)
GUICtrlSetBkColor(-1, $COLOR_GREEN)
$iRval = _SQLite_GetTable2d(-1, "SELECT * FROM persons;", $aResult, $iRows, $iColumns)
If $iRval = $SQLITE_OK Then
$tdEnd = TimerDiff($tdStart)
ConsoleWrite($tdEnd & @CRLF)
_GUICtrlListView_BeginUpdate($idListview)
GUICtrlCreateListViewItem($aResult[$i][0] & '|' & $aResult[$i][1], $idListview)
if Int($i, 2) Then GUICtrlSetBkColor(-1, $COLOR_GREEN) ;only even items must be coloured
$iPercent = Int($i / $iRows * 100)
If GUICtrlRead($idProgress) <> $iPercent Then
GUICtrlSetData($idProgress, $iPercent)
GUICtrlSetData($idPercent, $iPercent & ' %')
_GUICtrlListView_EndUpdate($idListview)
$tdEnd = TimerDiff($tdStart)
ConsoleWrite($tdEnd & @CRLF)
; Loop until the user exits.
Until GUIGetMsg() = $GUI_EVENT_CLOSE