Subject Re: [IBO] Re: IBOSecurityService
Author Helen Borrie
At 01:37 AM 30/04/2005 +0000, you 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;

First things first. If you dropped a TIBOSecurityService on your form and
named it 'ibss', why do you then, in your click event, also create and
destroy it?

>
>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???

This exception normally happens when the user presses cancel on the native
login prompt dialog. For its part, the IBOSS component, which wraps an
IB_Connection, never displays the login prompt.

In short, I can't find any way to stop it misbehaving, other than to drop
an explicit IB_Connection onto the form and have it connect to the security
database first. After that, you can take the login properties from that
connection and apply them to the IBOSecurityService object.

I've done a demo app that you can download from the Files area:
File : /Demo Apps/SecurityService.zip
Uploaded by : helebor <helebor@...>
Description : Demo User maintenance app using TIBOSecurityService

You can access this file at the URL:
http://groups.yahoo.com/group/IBObjects/files/Demo%20Apps/SecurityService.zip

Helen