I've gotten Autoit to communicate directly with the Sqlite dll by using the sqlite C api function prototypes given at http://sqlite.org/c_interface.html , but I need some help getting info out of the database. I'm able to update the database using an Autoit DllCall (my little test database has a single table called "toons"), and I can add to that table using an sqlite_exec function and executing an "insert into" query - that works just fine. It also works using the "sqlite_get_table" command. To return data to Autoit (my goal is to display data from the sqlite database in a listview), sqlite_exec requires the use of a callback function in Autoit, and I don't know if that's possible. The "sqlite_get_table" function in the sqlite api is supposed to allow retrieval of the data from an sql command without using a callback function, but the return value is supposed to be "int" - and it returns an array - I don't get that completely, but it happens. I've tried looking through all the elements of the array, but don't see any of the data from the database (index 2 returns the sql command, and index 1 returns a pointer to the data).
Here's what I've got so far. Can anyone help?
;OPEN DATABASE - this works fine
$result = DllCall("C:\test\sqlite.dll", "ptr", "sqlite_open", "str", "C:\test\myDB2.db")
msgbox(0, "sqlite_open", $result[0])
;INSERT DATA into database using "sqlite_exec" command - this works fine too
$exec = DllCall("C:\test\sqlite.dll", "int", "sqlite_exec", "ptr", $result[0], "str", "INSERT INTO toons (firstname,lastname) VALUES ('ugh','ugh')", "ptr", "", "ptr", "", "ptr", "")
msgbox(0, "sqlite_exec", $exec[0])
;READ DATA using "sqlite_exec" - don't know how to get this to work!
$execqqqq = DllCall("C:\test\sqlite.dll", "int", "sqlite_exec", "ptr", $result[0], "str", "SELECT * FROM toons", "ptr", "", "ptr", "", "ptr", "")
msgbox(0, "2nd sqlite_exec", $execqqqq[2])
;INSERT DATA into database using "sqlite_get_table" command - this one works
$execqq = DllCall("C:\test\sqlite.dll", "ptr", "sqlite_get_table", "ptr", $result[0], "str", "INSERT INTO toons (firstname,lastname) VALUES ('blah','blah')", "str", "", "int", "", "int", "", "str", "")
msgbox(0, "sqlite_get_table", $execqq[0])
;READ DATA using "sqlite_get_table" - don't know how to get this to work!
$execqqq = DllCall("C:\test\sqlite.dll", "ptr", "sqlite_get_table", "ptr", $result[0], "str", "SELECT * FROM toons", "str", "", "int", "", "int", "", "str", "")
msgbox(0, "sqlite_get_table_2", $execqqq[1])
;GET VERSION - this one also doesn't return the correct value
$version = DllCall("C:\test\sqlite.dll", "str", "sqlite_version")
msgbox(0, "Version", $version)
;CLOSE DATABASE - this works fine
$close = DllCall("C:\test\sqlite.dll", "none", "sqlite_close", "ptr", $result[0])
msgbox(0, "sqlite_close", $close)





