path of Sqlite3.dll

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Onis
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 22.04.2010, 03:03

path of Sqlite3.dll

Post by Onis »

I know Zeos need the Sqlite3.dll file in the root of the app. I would like to change the path to "C:\My data" or "My Documents", anywhere. How can I do that?
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Onis,

you can also copy this dll to the Windows\system path. If you realy want to have a own folder for this file go to the ZPlainSqLiteDriver.pas and change the WINDOWS_DLL3_LOCATION constant or declare it as global var and change this from your Application...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Onis
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 22.04.2010, 03:03

Post by Onis »

EgonHugeist,

I went to ZPlainSqLiteDriver.pas and declared the WINDOWS_DLL3_LOCATION as global var. Now from Application I can define the path.

Thank You
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello Onis,

another way might be to load the library yourself before zeos tries to load it. I do that for the firebird client library in some of my programs.
Best regards,

Jan
Onis
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 22.04.2010, 03:03

Post by Onis »

Hello Jan,

Do you mean use sqlite3.dll embeded inside App as resource? or add sqlite functions directly in the code?
Best regards,

Onis
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello Onis,

in my programs I do something like this to try to load the firebird client library before zeos tries to do it:

Code: Select all

var
  LibraryHandle: THandle;

procedure preloadLibrary(LibName: String);
begin
  if LibraryHandle <> 0 then FreeLibrary(LibraryHandle);

  if (LibName <> '') and (FileExists(LibName)) then begin
    LibraryHandle := LoadLibrary(PChar(FileName));
  end;
end;

...

  PreloadLibrary("C:\whateverpath\fbclient.dll");
Maybe it is possible to do something like this for SQLite too.

Best regards,

Jan
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Actually, it would be nice if somebody tried to find out how exactly you can add a new plaindriver object for a specific dll with the new plaindriver model in zeoslib 7.

When we rewrote this code we had the idea it would allow us to provide a feature that actually could create a new driver object based on an existing protocol (eg. sqlite3) but using the driver code with a different dll. But up to now nobody checked what would be needed to do it.

Mark
Image
Post Reply