BUG: SQLITE: At runtime, TUniConnection does not change dll path

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

BUG: SQLITE: At runtime, TUniConnection does not change dll path

Post by stevel » Thu 07 Jul 2011 19:13

The component has these properties set at design time because they are needed.

But at run-time, I need to change them so that when deployed on the target machine they pick up the paths from the installed directory. (SQLite3.dll is installed in same directory as application).

Code: Select all

procedure TfMain.FormCreate(Sender: TObject);
var
  startpath: string;
begin
  startpath := ExtractFilePath(ParamStr(0));

  UniConnection1.SpecificOptions.Values['ClientLibrary'] :=
    startpath + 'sqlite3.dll';

  UniConnection1.Database := startpath + 'mydb.db';

  UniConnection1.Open;
This gives an error :
Cannot load client dll: [design-time path of SQLite3.DLL]

So it is obvious that the code in FormCreate is not changing the ClientLibrary option value.

I am not sure about Database because I did not test.


However if at design time, the ClientLibrary path is cleared in the property editor and then project is compiled, then everything works at runtime ie. it sets the path properly and project works without error.

Can you confirm if this is a bug? If yes, how soon can you make a patch?

Regards,
Steve Faleiro

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

Post by AlexP » Fri 08 Jul 2011 10:43

Hello,


I cannot reproduce the problem. Please make sure that you are getting the correct path when calling the method:

startpath := ExtractFilePath(ParamStr(0));
For example:
ShowMessage(startpath);

If the path is correct, and the error persists, please send a small sample, reproducing the problem, to alexp*devart*com.
Also please specify the Delphi and UniDAC versions you are using.

stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

Post by stevel » Fri 08 Jul 2011 11:03

I have checked with ShowMessage, the path is correct. I am sending my source code to you. I am using Delphi XE and latest UniDAC, and latest sqlite3.dll.


Regards,
Steve Faleiro

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

Post by AlexP » Fri 08 Jul 2011 13:29

Hello,

Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.

Currently, you can resolve this issue in the following way: set the name of the option with an explicit definition of the provider's name:

Code: Select all

 UniConnection1.SpecificOptions.Values['SQLite.ClientLibrary'] :=    startpath + 'sqlite3.dll';

Post Reply