Application closing when Activating the Connection on FireDAC

130 views Asked by At

I developed an application that uses FireDAC to connect to a MySQL Database. But when I try to open it on a workstation, at the moment that I set the Connected := True; on the TFDConnection, the application closes itself without showing an exception. It is surrounded with a try...except, but still doesn't show no error message at all. Here's the code I'm using to set the connection:

procedure TfrmServidor.confConnection;
begin
  with conMySQL do begin
    DriverName := LeXML.Strings[5];
    Params.Add('Server=' + LeXML.Strings[3]);
    Params.Add('Port=' + LeXML.Strings[4]);
    Params.Add('Database=' + LeXML.Strings[0]);
    Params.Add('User_Name=' + LeXML.Strings[1]);
    Params.Add('Password=' + LeXML.Strings[2]);
    ShowMessage(Params.Text);
  end;

  try
     conMySQL.Connected := True;
  except
     on e : Exception do
       ShowMessage(e.Message);
  end;
end;

Where LeXML is a function that reads a XML file with the properties and returns the values on a TStringList.
What is it that i'm doing wrong? The ShowMessage with the Params Text returns the following:

[Window Title]
Servidor

[Content]
DriverID=MySQL
Server=10.1.1.16
Port=3306
Database=treinamentos
User_Name=treinamentos
Password=masterkey


[OK]

Can anyone help?

0

There are 0 answers