mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
Give the user a hint to download VC redistributable if PostgreSQL dll fails to assign a procedure. See https://www.heidisql.com/forum.php?t=18580#p34297
This commit is contained in:
@ -2231,13 +2231,27 @@ end;
|
||||
|
||||
procedure TPgConnection.DoBeforeConnect;
|
||||
var
|
||||
LibraryPath: String;
|
||||
LibraryPath,
|
||||
msg: String;
|
||||
begin
|
||||
// Init lib before actually connecting.
|
||||
LibraryPath := ExtractFilePath(ParamStr(0)) + Parameters.LibraryFile;
|
||||
Log(lcDebug, f_('Loading library file %s ...', [LibraryPath]));
|
||||
FLib := TPostgreSQLLib.Create(LibraryPath);
|
||||
Log(lcDebug, FLib.DllFile + ' v' + IntToStr(FLib.PQlibVersion) + ' loaded.');
|
||||
try
|
||||
FLib := TPostgreSQLLib.Create(LibraryPath);
|
||||
Log(lcDebug, FLib.DllFile + ' v' + IntToStr(FLib.PQlibVersion) + ' loaded.');
|
||||
except
|
||||
on E:EDbError do begin
|
||||
msg := E.Message;
|
||||
if E.ErrorCode = TDbLib.LIB_PROC_ERROR then begin
|
||||
msg := msg + sLineBreak + sLineBreak +
|
||||
f_('Installing VC redistributable might help: %s',
|
||||
['https://support.microsoft.com/en-us/help/3179560/update-for-visual-c-2013-and-visual-c-redistributable-package']
|
||||
);
|
||||
end;
|
||||
raise EDbError.Create(msg, E.ErrorCode);
|
||||
end;
|
||||
end;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user