0
I have developed an application that uses Firedac to connect to Mysql. But when I try to open it on a station, at the time when the Connected := True
, the application is closed, without returning any Exception. I wrapped the code in a try...except
, but still shows no error message. Here is the code I use for 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 an XML file with connection properties and returns the values in a Tstringlist.
What did I do 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 someone help me?