I'm using this code to login to a MySQL server :
try
MySQL50Connection1.Connected:=true;
except
on E : Exception do
if E is EDatabaseError then
showmessage('Unknown hostname or username:' + E.Message)
else
showmessage('Error: ' + E.ClassName + sLineBreak + ' message is: ' + E.Message);
end;
This way I cant tell what was wrong, the hostname or the username, the error message is always the same: "Server connect failed".
Is there a possibility to get the exact reason of the failure: hostname unknow, username unknown ?
Thanks