dxStatusbar1.Panels1.Text := DataModule2.UniConnectDialog1.Connection.Username;
...gives me the username that has connected to sql server. However the connected user has a different name in the actual database.
Example: His login name for the sql server is 'John' and is user mapped to 'Northwind' database. However in 'Northwind' database he is called 'John Smith'. And this is the name (John Smith) I am trying to have displayed in dxStatusbar1.Panels1.Text after he connects.
How can I get that ?
edit : Tried Victoria suggestion :
UserName := DataModule2.UniConnection1.ExecSQL('SELECT :Result = CURRENT_USER', ['Result']);
dxStatusbar1.Panels[1].Text := UserName;
but get :