Jump to content

Recommended Posts

Posted

Hi guys 

I downloaded the DLL from the official site — DLL for Windows x64, SQLite version 3.51.0.
I installed AutoIt in the 64-bit version, and I’m on Windows 10 64-bit.

I placed sqlite3.dll in System32, SysWOW64, and in the same folder where the script is located.
However, when I run the following script, it always returns the error:
“sqlite3.dll cannot be loaded.”

Does anyone have an idea why this is happening?

my code: 

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

_SQLite_Startup(@ScriptDir & "\sqlite3.dll", False, 1)
If @error Then
    MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!")
    Exit -1
EndIf
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)


Local $hTmpDb = _SQLite_Open('C:\Users\pct\AppData\Roaming\MetaQuotes\Terminal\E5B837F0138DF324D68A7D88E1F3C2C3\MQL5\Files\MonitorTRade.db') ; Creates a temporary disk database
If @error Then
    MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't create a temporary Database!")
    Exit -1
EndIf


_SQLite_Close($hTmpDb)
_SQLite_Shutdown()

 

sqlite3.dll

  • Solution
Posted
...
Func _SQLite_Startup($sDll_Filename = "", $bUTF8ErrorMsg = False, $iForceLocal = 0, $hPrintCallback = $__g_hPrintCallback_SQLite, $bAutoItTypeConversion = False)
...
    If $sDll_Filename = "" Then $sDll_Filename = "sqlite3.dll"
    If @AutoItX64 And (StringInStr($sDll_Filename, "_x64") = 0) Then $sDll_Filename = StringReplace($sDll_Filename, ".dll", "_x64.dll")
...

..therefore, your x86 DLL stays as is named in the zip. The x64 version from the zip file needs to be renamed to sqlite3_x64.dll.
Do that and you'll be running it without issues :) 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...