Sign in to follow this  
Followers 0
Edifice

Getting data from SQlite into GUI

2 posts in this topic

This is my function so far:

Func data_query()
    Local $aResult, $iRows, $iColumns, $iRval
    $iRval = _SQLite_GetTable2d (-1, "SELECT * FROM datas;", $aResult, $iColumns, $iRows)
    If $iRval = $SQLITE_OK Then
    _SQLite_Display2DResult($aResult)
    EndIf
EndFunc

The Display 2d part was really just a testing thing, and I' not planning to use it for anything.

Anyway, I now need a way to get a single row of data loaded into different GUI-controls.

I would express it like this: "Select this row" -> "put this colum into that GUICtrl" -> "put this one into that" ... and so on. However Auto-it doesn't understand :D

I tried the helpfile but I think it's a bit weak when it comes to SQLite - or I'm just to stupid to find it :unsure:

Any help is appreciated! :P

Share this post


Link to post
Share on other sites



I'm quiet sure AU can handle anything SQLite can throw at it, just look at my SMF program as an example :P...

It's just a question how to do that. Read the SQLite result into an array, loop through that array and perform your tasks depending on your data-structure / rowid you choose.

$array = data_query()
if IsArray($array) Then
    for $i = 1 to UBound($array) - 1
    ; do something per returned result
    Next
Else
; do error handling
EndIf

Func data_query()
    Local $aResult, $iRows, $iColumns, $iRval
    $iRval = _SQLite_GetTable2d (-1, "SELECT * FROM datas;", $aResult, $iColumns, $iRows)
    If $iRval <> $SQLITE_OK Then
        ConsoleWrite("SQLite Error Code: " & _SQLite_ErrCode() & @tab & "SQLite Error Message: " & _SQLite_ErrMsg() & @crlf)
        Return 0
    Else
        Return $aResult
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0