Subject RE: [IBO] Services API components for FB 2.0
Author Alan McDonald
> On Wed, 03 Oct 2007, Alan McDonald wrote:
> > > Are there any components for working with the FB 2.0 services
> > > API? I have the
> > > IBOAdmin components but they only seem to support FB 1.5, or is
> > > there a new
> > > version available somewhere?
> > >
> > > I need to be able to create/modify some predefined user
> accounts BEFORE
> > > creating the application's database (for new installations). With
> > > FB 1.5 I
> > > did this by connecting to security.fdb first to setup the
> > > accounts. With FB
> > > 2.0 I can't do this, so I assume I need to use the services
> API for this.
> > >
> > > Thanks for any suggestions.
> > >
> > > Tom
> >
> > the IBOAdmin components work fine for me with FB2 (all builds).
> What's your
> > issue with them?
> > Alan
> >
> I haven't used them before Alan so I may be doing things wrong.
> To start with
> I want to use TIBOSecurityService to set up my user accounts, but I don't
> have any documentation to tell me how to make Attach work. I've set the
> username/password properties of the component but it's not
> logging on. Can
> you point me at any samples to show how to use this?
>
> Tom

apart from the obvious (e.g. servername property..)
make sure you use cpTCP_IP ansd set the params as
'user_name=SYSDBA'
'password=masterkey'

then set the active property True
then call DisplayUsers method to fill the buffer
with IBOSecurityService1 do begin
DisplayUsers;
for i:=0 to UserInfoCount-1 do begin
if ((UserInfo[i].LastName<>'') and (UserInfo[i].LastName<>' ')) then
dispName := UserInfo[i].LastName+', ';
if ((UserInfo[i].FirstName<>'') and (UserInfo[i].FirstName<>' ')) then
dispName := dispName + UserInfo[i].FirstName;

you get the picture

OR do this
with IBOSecurityService1 do begin
// Save the user info
UserName := gUserName;
FirstName := gFirstName;
MiddleName := gEmail;
LastName := gLastName;
Password := gPassword;
GroupID := gGroup;
Active := True;
ModifyUser;
end;
OR this
with IBOSecurityService1 do begin
// Modify the user info
UserName := gUserName;
FirstName := gFirstName;
MiddleName := gEmail;
LastName := gLastName;
Password := gPassword;
GroupID := gGroup;
Active := True;
AddUser;

Alan