mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Load libpq.dll with full path, so the LoadLibrary does not accidentally take a different (probably wrong) one from somewhere else than the current directory. See http://www.heidisql.com/forum.php?t=21039
This commit is contained in:
@ -2090,12 +2090,15 @@ end;
|
||||
|
||||
|
||||
procedure TPgConnection.DoBeforeConnect;
|
||||
var
|
||||
LibWithPath: String;
|
||||
begin
|
||||
// Init lib before actually connecting.
|
||||
// Each connection has its own library handle
|
||||
if LibPqHandle = 0 then begin
|
||||
Log(lcDebug, f_('Loading library file %s ...', [LibPqPath]));
|
||||
LibPqHandle := LoadLibrary(PWideChar(LibPqPath));
|
||||
LibWithPath := ExtractFileDir(Application.ExeName) + '\' + LibPqPath;
|
||||
Log(lcDebug, f_('Loading library file %s ...', [LibWithPath]));
|
||||
LibPqHandle := LoadLibrary(PWideChar(LibWithPath));
|
||||
if LibPqHandle = 0 then
|
||||
raise EDatabaseError.CreateFmt(_('Cannot find a usable %s. Please launch %s from the directory where you have installed it.'), [LibPqPath, ExtractFileName(ParamStr(0))])
|
||||
else begin
|
||||
|
Reference in New Issue
Block a user