#1 2014-09-30 09:24:53

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

UniDAC 5.5.11 Problem

Hi ab,

i updated to UniDAC 5.5.11 yesterday and get an Error Message Connecting to MySQL.
In UniDAC there is a new Validation Function which checks the SpecificOptions if you add / modify any.

Server and Port is no valid Option for this.

so i Modified SynDBUniDAC.pas a little

constructor TSQLDBUniDACConnection.Create(aProperties: TSQLDBConnectionProperties);
var options: TStrings;
    PortNumber : Integer;
begin
  inherited Create(aProperties);
  fDatabase := TUniConnection.Create(nil);
  fDatabase.ProviderName := UTF8ToString(fProperties.ServerName);
  case aProperties.DBMS of
  dSQLite, dFirebird, dPostgreSQL, dMySQL, dDB2:
    fDatabase.Database := UTF8ToString(fProperties.DatabaseName);
  else
    fDatabase.Server := UTF8ToString(fProperties.DatabaseName);
  end;
  options := (fProperties as TSQLDBUniDACConnectionProperties).fSpecificOptions;
  if fDatabase.Server='' then // see TSQLDBUniDACConnectionProperties.URI()
    fDatabase.Server := options.Values['Server'];
  if fDatabase.Database='' then
    fDatabase.Database := options.Values['Database'];
  if (fDatabase.Port=0) and TryStrToInt(options.Values['Port'], PortNumber) then
    fDatabase.Port := PortNumber;
  fDatabase.Username := UTF8ToString(fProperties.UserID);
  fDatabase.Password := UTF8ToString(fProperties.PassWord);
// BUGFIX s.d. UniDAC 5.5.11 Überprüft ungültige Parameter
//  fDatabase.SpecificOptions.AddStrings(options);
end;

I removed the last line cause Server and Port where the only Options.

Pls Check if there could be any unknown consequences i did not see.


Rad Studio 12.1 Santorini

Offline

#2 2014-09-30 10:27:53

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: UniDAC 5.5.11 Problem

Does http://synopse.info/fossil/info/07db9ce72a works as expected now?

Online

#3 2014-09-30 13:56:25

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Re: UniDAC 5.5.11 Problem

Just tested it and it works.


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB