BUG: SQLITE: At runtime, TUniConnection does not change dll path
Posted: 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).
This gives an error :
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
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;
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