Subject Re: IBOSecurityService
Author Marco André
Hi jdlynn123,

Try setting LoginPrompt to false:

ibss := TIBOSecurityService.Create(IB_Connection1);
try
ibss.ServerName := IB_Connection1.Server;
ibss.LoginPrompt := False;
ibss.Params.Clear;
ibss.Params.Add('user_name=SYSDBA');
ibss.Params.Add ('password=masterkey');
ibss.UserName := 'jdlynn';
ibss.Password := 'test123';
ibss.Active := True;
ibss.AddUser;
ibss.Active := False;
finally ibss.free;
end;

--- In IBObjects@yahoogroups.com, "jdlynn123" <jdlynn123@y...> wrote:
> Still struggling with this... Here's what I have
>
> I added a TIBOSecurityService to my form and named it 'ibss'. I
then
> added a button and added the following lines of code to the click
event:
> ibss := TIBOSecurityService.Create(IB_Connection1);
> try
> ibss.ServerName := IB_Connection1.Server;
> ibss.Params.Clear;
> ibss.Params.Add('user_name=SYSDBA');
> ibss.Params.Add ('password=masterkey');
> ibss.UserName := 'jdlynn';
> ibss.Password := 'test123';
> ibss.Active := True;
> ibss.AddUser;
> ibss.Active := False;
> finally ibss.free;
> end;
>
> I get an exeception "project raisded exception class EIBOClientError
> with message 'Operation cancelled at user's request'. Process
topped.
> Use Step or Run to continue"
>
> Any ideas???
>
> --- In IBObjects@yahoogroups.com, "Dmitry Beloshistov" <torin@s...>
wrote:
> > Hello, jdlynn123!
> > You wrote to <IBObjects@yahoogroups.com> on Fri, 29 Apr 2005
> 11:50:11 -0000:
> >
> > j> Does anyone have an example of how to add a new user using
this
> > j> component??
> >
> > Some around this:
> >
> > Uses IBOAdmin;
> >
> > IBSS:=TIBOSecurityService.Create(IB_Connection);
> > try
> > IBSS.ServerName:=IB_Connection.Server;
> > IBSS.Params.Clear;
> > IBSS.Params.Add('user_name='+IB_Connection.Username);
> > IBSS.Params.Add('password='+IB_Connection.Password);
> > IBSS.UserName:='NEWUSER';
> > IBSS.Password:='1234';
> > IBSS.Active:=True;
> > IBSS.AddUser;
> > IBSS.Active:=False;
> > finally IBSS.Free; end;
> >
> > WBR,Dmitry Beloshistov AKA [-=BDS=-]