Login to sqlserver
-
Moondancer
- Posts: 9
- Joined: Tue 10 Apr 2012 14:07
Login to sqlserver
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
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;