taurus905 Posted November 12, 2023 Share Posted November 12, 2023 Hello, Please direct me to the latest SQLite.au3 and SQLite.dll.au3 versions. I get this error when running the below script: Can't open the database: test.db Error code: 3 Error message: Library used incorrectly Thank you. taurus905 #include <SQLite.au3> #include <SQLite.dll.au3> ; Initialize SQLite _SQLite_Startup() ConsoleWrite("SQLite version: " & _SQLite_LibVersion() & @CRLF) ; Open the database Global $sDatabasePath = @ScriptDir & "\test.db" _SQLite_Open($sDatabasePath) If @error Then MsgBox($MB_ICONERROR, "Error", "Can't open the database: " & $sDatabasePath & @CRLF & "Error code: " & @error & @CRLF & "Error message: " & _SQLite_ErrMsg()) Else MsgBox($MB_ICONINFORMATION, "Success", "Database opened successfully.") EndIf ; Clean up _SQLite_Close() _SQLite_Shutdown() "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
benners Posted November 12, 2023 Share Posted November 12, 2023 The link is in the help file latest SQLite Put the dll in the directories specified in the help file or specify one using the optional parameter. taurus905 1 Link to comment Share on other sites More sharing options...
taurus905 Posted November 12, 2023 Author Share Posted November 12, 2023 I may have misidentified my issue. I cannot get "Example 1" in the Help File to run. I get this error even though the SQLite3.dll is in the same directory as the script. I've tried the x86 version, as well as the x64. It looks like my issue is with the naming, since some state "SQLite3.dll" and other are without the "3". SQLite Error --------------------------- SQLite3.dll Can't be Loaded! Not FOUND in @ScriptDir, @WorkingDir, @LocalAppDataDir\AutoIt v3\SQLite, @SystemDir or @WindowsDir ; SQLite.dll version must match #include <MsgBoxConstants.au3> #include <SQLite.au3> #include <SQLite.dll.au3> Local $sSQliteDll = _SQLite_Startup() If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _ "Not FOUND in @ScriptDir, @WorkingDir," & @CRLF & @TAB & "@LocalAppDataDir\AutoIt v3\SQLite," & @CRLF & @TAB & "@SystemDir or @WindowsDir") Exit -1 EndIf MsgBox($MB_SYSTEMMODAL, "SQLite3.dll Loaded", $sSQliteDll & " (" & _SQLite_LibVersion() & ")") ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) _SQLite_Shutdown() Any help in clearing this up for me would be greatly appreciated. I believe I had this same problem years ago and just moved on. One working example is all I need. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
argumentum Posted November 12, 2023 Share Posted November 12, 2023 (edited) 1 hour ago, taurus905 said: One working example is all I need. #include <MsgBoxConstants.au3> #include <SQLite.au3> ; #include <SQLite.dll.au3> Local $sSQliteDll = _SQLite_Startup(@ScriptDir & "\sqlite3" & (@AutoItX64 ? "_x64" : "") & ".dll", False, 1) ; open localy If @error Then $sSQliteDll = _SQLite_Startup() ; _SQLite_Startup ( [$sDll_Filename = "" [, $bUTF8ErrorMsg = False [, $iForceLocal = 0 [, $hPrintCallback = $__g_hPrintCallback_SQLite]]]] ) If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3" & (@AutoItX64 ? "_x64" : "") & ".dll Can't be Loaded!" & @CRLF & @CRLF & _ "Not FOUND in @ScriptDir, @WorkingDir," & @CRLF & @TAB & "@LocalAppDataDir\AutoIt v3\SQLite," & @CRLF & @TAB & "@SystemDir or @WindowsDir") Exit -1 EndIf MsgBox($MB_SYSTEMMODAL, "SQLite3" & (@AutoItX64 ? "_x64" : "") & ".dll Loaded", $sSQliteDll & " (" & _SQLite_LibVersion() & ")") ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) ; Open the database Global $sDatabasePath = @ScriptDir & "\test.db" _SQLite_Open($sDatabasePath) If @error Then MsgBox($MB_ICONERROR, "Error", "Can't open the database: " & $sDatabasePath & @CRLF & "Error code: " & @error & @CRLF & "Error message: " & _SQLite_ErrMsg()) Else MsgBox($MB_ICONINFORMATION, "Success", "Database opened successfully.") EndIf ; Clean up _SQLite_Close() _SQLite_Shutdown() hope this is clear enough Edited November 12, 2023 by argumentum better code Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
ioa747 Posted November 13, 2023 Share Posted November 13, 2023 An example that impressed me with the simplicity of using SQLite can be found in the link below https://www.autoitscript.com/forum/topic/210140-bulldozer Andreik 1 I know that I know nothing Link to comment Share on other sites More sharing options...
taurus905 Posted November 13, 2023 Author Share Posted November 13, 2023 23 hours ago, argumentum said: hope this is clear enough @argumentum Thank you for trying to help me. But I still get this same error. I will figure it out in time. taurus905 SQLite Error --------------------------- SQLite3.dll Can't be Loaded! Not FOUND in @ScriptDir, @WorkingDir, @LocalAppDataDir\AutoIt v3\SQLite, @SystemDir or @WindowsDir "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
taurus905 Posted November 13, 2023 Author Share Posted November 13, 2023 18 hours ago, ioa747 said: An example that impressed me with the simplicity of using SQLite can be found in the link below https://www.autoitscript.com/forum/topic/210140-bulldozer @ioa747 Thank you for the example. I will take a look. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Solution Andreik Posted November 13, 2023 Solution Share Posted November 13, 2023 (edited) Where is your sqlite3.dll located after all? And is your application 32 or 64 bit? Edit: check the attached archive and run the example and let me know if it works Edited November 14, 2023 by Andreik taurus905 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
taurus905 Posted November 14, 2023 Author Share Posted November 14, 2023 17 hours ago, Andreik said: Edit: check the attached archive and run the example and let me know if it works @Andreik You're the best! It works. Thank you. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Andreik Posted November 14, 2023 Share Posted November 14, 2023 Glad you got a solution. I will delete the attachment above because my attachment quota is 100% and I need some free space. In case you need it again just PM me. taurus905 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now