Cannot load client library: sqlite3.dll

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
thorgal
Posts: 10
Joined: Fri 18 Sep 2009 14:33

Cannot load client library: sqlite3.dll

Post by thorgal » Thu 11 Sep 2014 12:10

Hello,
Everything worked in the trial version, when I used direct mode.
I purchased a standard version ( did not notice that direct mode is not included) and now I have to use sqlite3.dll.
I pointed to the path with dll file but get the error that the project "Cannot load client library:C:\User\chris\documents\dev\delphi\sqlite_test\sqlite3.dll".

The design component LiteConnection1 shows a green icon when I selected connect.
Under database I pointed to my sqlite database.
Under client library I pointed to my sqlite3.dll file.
Any suggestion would be appreciated.
At this point, I cannot compile my project.

Thanks,
Chris
PS.
How can I insert images here ?
Should I dropbox public folder and insert a link under URL tag ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Cannot load client library: sqlite3.dll

Post by AlexP » Thu 11 Sep 2014 12:57

Hello,

Please specify:
1) the exact LiteDAC version;
2) the exact IDE version;
3) the exact SQLite3.dll library version;
4) the bitness of the created application.

thorgal
Posts: 10
Joined: Fri 18 Sep 2009 14:33

Re: Cannot load client library: sqlite3.dll

Post by thorgal » Thu 11 Sep 2014 13:35

LiteDac: 2.3.9
XE6 Update 1
Windows 7 Pro
sqlite version 3.07
Please note that I initially declared everything to execute at run time.
As a test, I used a design component LiteConnection in this function.

Here is a code:

Code: Select all

function TRoutesList.FGetList: TStringList;
var
  i : integer;
  sqliteQuery : TLiteQuery;
  //sqliteConnection : TLiteConnection;
  
  sqlQry :  TSqlStatements;
  databasePath : string;
begin
    FSriroutes :=  TStringList.create();
    
    sqlQry := TSqlStatements.create(FUserInput);

    sqliteQuery := TLiteQuery.Create(nil);

    try
      //sqliteConnection.LoginPrompt := false;
      //sqliteConnection.Database := databasePath;
      //sqliteConnection.Options.Direct := true;  -- it does not work with Standard ODAClite library - 
       
       //using a connection from  a design component
      sqliteConnection.Open;

     
      //connection string from  a form: Client Library=C:\Users\tpdzaja\Documents\Dev\Delphi\sqlite_fireDac\sqlite3.dll;Database=C:\Users\tpdzaja\Documents\Dev\Delphi\sqlite_fireDac\dv.db3	
     if not(sqliteForm.LiteConnection1.Connected) then
        sqliteForm.LiteConnection1.Open;

      sqliteQuery.Connection := sqliteForm.LiteConnection1;
      sqliteQuery.ReadOnly := true;
      sqliteQuery.SQL.Clear;
      sqliteQuery.SQL.Add(sqlQry.stateSql);
      sqliteQuery.Prepared := true;
      sqliteQuery.Execute;

      ShowMessage('number of records '+ IntToStr(sqliteQuery.RecordCount));
       
      // TEST Loop 
      for i := 0 to sqlFireDacQuery.RecordCount-1 do
      begin
        FSriRoutes.Add(sqlFireDacQuery.Fields[0].AsString);
        sqlFireDacQuery.Next;
      end;


    finally
      sqliteForm.LiteConnection1.Close;
      sqliteQuery.Free;

    end;
    Result:= FSriRoutes;
end;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Cannot load client library: sqlite3.dll

Post by AlexP » Thu 11 Sep 2014 14:53

What application are your developing: 32-bit or 64-bit?

thorgal
Posts: 10
Joined: Fri 18 Sep 2009 14:33

Re: Cannot load client library: sqlite3.dll

Post by thorgal » Thu 11 Sep 2014 15:01

My Target platform is Win64.
My Windows 7 is 64Bit.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Cannot load client library: sqlite3.dll

Post by AlexP » Thu 11 Sep 2014 15:09

For a 64-bit application you should use a 64-bit library at run-time. Since Delphi is a 32-bit application, you can connect to the database using a 32-bit library at design-time.

thorgal
Posts: 10
Joined: Fri 18 Sep 2009 14:33

Re: Cannot load client library: sqlite3.dll

Post by thorgal » Thu 11 Sep 2014 15:33

Thank you for you help.
I have downloaded the latest WIN64 DLL for Sqlite.
Recompiled the project and worked.

Thanks again.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Cannot load client library: sqlite3.dll

Post by AlexP » Thu 11 Sep 2014 15:41

Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.

Post Reply