Subject | Re: [IBO] howto: Save and Reuse Login Information - SOLUTION |
---|---|
Author | Gary Holbrook |
Post date | 2002-06-18T00:36Z |
Thank you to all - Artur/Guido/Helen! Helen, I just downloaded the 4.2 help
file :-)
Here is what I ended up with... My TIB_Connection component is named
"AdminDatabase". I am using Turbopowers' stRegINI component in a globals
unit where the ReadREG... and WriteREG... functions are.
Thanx again,
G
Gary Holbrook
----------------------------------------------------------------------------
----------------------
procedure TRDAdminMainForm.AdminDatabaseAfterConnect( Sender:
TIB_Connection);
begin
if not WriteREGLoginInfo(AdminDatabase.Username, AdminDatabase.SQLRole)
then
MessageDlg('Problem writing Login info to Registry',mtWarning,[mbOK],0);
end;
procedure TRDAdminMainForm.AdminDatabaseLogin(Sender: TIB_Connection; var
AbortLogin: Boolean);
var strUser, strRole: String;
begin
if ReadREGLoginInfo(strUser, strRole) then
begin
AdminDatabase.Username := strUser;
AdminDatabase.SQLRole := strRole;
end
else
MessageDlg('Problem reading Login info from
Registry',mtWarning,[mbOK],0);
end;
file :-)
Here is what I ended up with... My TIB_Connection component is named
"AdminDatabase". I am using Turbopowers' stRegINI component in a globals
unit where the ReadREG... and WriteREG... functions are.
Thanx again,
G
Gary Holbrook
----------------------------------------------------------------------------
----------------------
procedure TRDAdminMainForm.AdminDatabaseAfterConnect( Sender:
TIB_Connection);
begin
if not WriteREGLoginInfo(AdminDatabase.Username, AdminDatabase.SQLRole)
then
MessageDlg('Problem writing Login info to Registry',mtWarning,[mbOK],0);
end;
procedure TRDAdminMainForm.AdminDatabaseLogin(Sender: TIB_Connection; var
AbortLogin: Boolean);
var strUser, strRole: String;
begin
if ReadREGLoginInfo(strUser, strRole) then
begin
AdminDatabase.Username := strUser;
AdminDatabase.SQLRole := strRole;
end
else
MessageDlg('Problem reading Login info from
Registry',mtWarning,[mbOK],0);
end;