Page 1 of 1

Login to sqlserver

Posted: Sat 12 Jul 2014 23:45
by Moondancer
To login I use UniConnectDialog1. How can I pass the name of the user and the name of the database to which the user just logged (if login was successful) to statusbar panel text (1,2)?

Re: Login to sqlserver

Posted: Tue 15 Jul 2014 14:26
by azyk
You can retrieve user name and database name on successful logging in in the TUniConnection.AfterConnect event. For example:

Code: Select all

procedure TForm1.UniConnectionAfterConnect(Sender: TObject);
begin
  StatusBar.Panels[1].Text := UniConnectDialog1.Connection.Database;
  StatusBar.Panels[2].Text := UniConnectDialog1.Connection.Username;
end;