I am trying to connect to a MySQL database and its not working.
When I type all of the information into TUniConnection that I drop onto the main form it works, however when I create one in code and fill out the parameters with the same information it fails
Code: Select all
Conn := TUniConnection.Create(self);
Conn.ProviderName:= 'MySQL';
Conn.Username:='username';
Conn.Password:= 'Password'
Conn.Server := '97.75.23.17';
Conn.Database:= 'mydatabase';
// Conn.Port := 3306;
Conn.Connect;
if Conn.Connected then
begin
tbl := TUniTable.Create(Self);
tbl.Connection := Conn;
tbl.TableName := 'Test';
tbl.Open;
tbl.FindFirst;
ShowMessage(tbl.FieldByName('idTest').AsString);
end;
Conn.Close;
NOTE: The result is the same no matter if I set the port or not.
Thank you for your help,
Tim