Hi all,
Im sure this question has been answered before, but i have searched and could not find it.
Im converting an old project of mine to use dbExpress instead of an older mysql component i've used.
The problem is i cant seem to be able to set hostname, username password etc. during runtime?
I've been trying to set it using SQLConnection1.Driver.HostName:='localhost'; but that wont compile, stating that 'TSQLConnection does not contain a member named 'driver'' even though the object inspector would suggest that it does.
What am I doing wrong?
Setting hostname during runtime?
To specify hostname, port, username and password you should set the appropriate parameters of TSQLConnection, like this:
Code: Select all
SQLConnection1.Params.Values['HostName'] := HostName;
SQLConnection1.Params.Values['Port'] := Port;
SQLConnection1.Params.Values['UserName'] := UserName;
SQLConnection1.Params.Values['Password'] := Password;