2

I have a problem with SQLite v3.22.0 and AutoIt v3.3.14.3. Trying to create a database works but the table does not get created. I use the AutoIt example code:

#include <MsgBoxConstants.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>

Local $hQuery, $aRow, $sMsg
_SQLite_Startup()
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
_SQLite_Open() ; open :memory: Database
_SQLite_Exec(-1, "CREATE TABLE aTest (a,b,c);") ; CREATE a Table
_SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('c','2','World');") ; INSERT Data
_SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('b','3',' ');") ; INSERT Data
_SQLite_Exec(-1, "INSERT INTO aTest(a,b,c) VALUES ('a','1','Hello');") ; INSERT Data
_SQLite_Query(-1, "SELECT c FROM aTest ORDER BY a;", $hQuery) ; the query
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
    $sMsg &= $aRow[0]
WEnd
_SQLite_Exec(-1, "DROP TABLE aTest;") ; Remove the table
MsgBox($MB_SYSTEMMODAL, "SQLite", "Get Data using a Query : " & $sMsg)
_SQLite_Close()
_SQLite_Shutdown()

; Output:
; Hello World

If I request the SQLite error, I get "Library used incorrectly". What's the problem in this case?

user4157124
  • 2,809
  • 13
  • 27
  • 42
Christian Nill
  • 143
  • 1
  • 7

2 Answers2

1

Whats the problem in this case?

As per Documentation - Script breaking changes :

_SQLite_Startup() function no longer automatically downloads the SQLite DLL files from autoitscript.com. Most users were completely unaware that this download was occuring on each script run and it was also a severe bandwidth hog for the website. The SQLite DLLs must now be manually download. See the _SQLite_Startup() documentation for details.

If _SQLite_Startup()'s first parameter is omitted, then dll file must reside in @SystemDir, @WindowsDir, @ScriptDir or @WorkingDir for this function to succeed.

  1. Download sqlite3.dll,
  2. remove #include <SQLite.dll.au3>, then
  3. provide _SQLite_Startup()'s first parameter with location of dll file (redundant if present in one of four previously mentioned locations).

Related.

user4157124
  • 2,809
  • 13
  • 27
  • 42
  • Tried now many possible solutions. None of them works. If i try to get the lib version i get 3.22.0 so the library is there and is loaded but all actions i run with autoit are failing. – Christian Nill Feb 28 '18 at 19:55
0

AutoIt v3.3.14.3 has a bug; install AutoIt v3.3.14.2 or get the bug-fix.

user4157124
  • 2,809
  • 13
  • 27
  • 42
Christian Nill
  • 143
  • 1
  • 7