Page 1 of 1

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

Posted: Thu 07 Jul 2011 19:13
by stevel
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

Posted: Fri 08 Jul 2011 10:43
by AlexP
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.

Posted: Fri 08 Jul 2011 11:03
by stevel
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

Posted: Fri 08 Jul 2011 13:29
by AlexP
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';