Board index » delphi » Create User on an Interbase db from Delphi

Create User on an Interbase db from Delphi

Hi!

I would like to create (or add) user to an Interbase (IB 5) database from a
Delphi application. And as far as I know the only way to do that is by
calling certain API's.

So my question is:
How the heck can I get access to these API's from Delphi as every single
example and source files supplied from Inprise / Interbase are made in C.

I do not have a C-compiler.

Pleas anyone!

I'm soon beginning to believe it would have been a better choice to use
SYBASE or ORACLE rather than Interbase??

oyvind.myrs...@edbgruppen.no

 

Re:Create User on an Interbase db from Delphi


Quote
?yvind Myrseth wrote in message <7kvufa$f4...@forums.borland.com>...

>I would like to create (or add) user to an Interbase (IB 5) database from a
>Delphi application. And as far as I know the only way to do that is by
>calling certain API's.

You can connect to the Interbase security database (ISC4.gdb) just like any
other IB database - set up an alias for it and attach your TDatabase
component.

Then all you have to do is figure out how to correctly encrypt user
passwords in order to add them to ISC4. Visit www.mers.com for lots of IB
knowledge in general, including needed Pascal source code.

For each user you create, you must also grant privileges within each
application database you want the user to access.

--
Wayne Niddery - WinWright Consulting
RADBooks - http://home.ican.net/~wniddery/RADBooks.html
Bill of NO Rights; ARTICLE I:  You do NOT have the right to a new car, big
screen TV or any other form of wealth. More power to you if you can legally
acquire them, but no one is guaranteeing anything.

Re:Create User on an Interbase db from Delphi


Take a look at FREEIBCOMPONENTS on the Interbase web site.  It has a Delphi
interface to the Interbase API.  You'll also need to review the Interbase
API document.

Here's some sample code that I use:

procedure AddInterbaseUser;
Var Status_Vector:Array[1..20] Of LongInt;
    User_Sec_Data:TUserSecData;
begin
    FillChar(User_Sec_Data,SizeOf(User_Sec_Data),#0);
    FillChar(Status_Vector,SizeOf(Status_Vector),#0);
    With User_Sec_Data Do
    Begin
        Sec_Flags:=sec_password_spec or sec_dba_user_name_spec
                      or sec_dba_password_spec or sec_server_spec;//$300;
        Server:=PChar(GlobalServerName);
        if GlobalPotocol= PROTOCOL_LOCAL then
          Protocol:=Sec_Protocol_Local
        else if GlobalPotocol= PROTOCOL_TCPIP then
          Protocol:=Sec_Protocol_TCPIP
        else if GlobalPotocol= PROTOCOL_NETBEUI then
          Protocol:=Sec_Protocol_NETBEUI;

        User_Name:=StrAlloc(Length(EditLoginName.Text)+1);
        Password:=StrAlloc(Length(EditPassword.Text)+1);
        dba_User_Name:=StrAlloc(7);
        dba_Password:=StrAlloc(10);
        StrPCopy(User_Name,EditLoginName.Text);
        StrPCopy(Password,EditPassword.Text);
        StrPCopy(dba_User_Name,GlobalUserName);
        StrPCopy(dba_password,GlobalPassword);
    End; {with}
    ISC_Add_User(@Status_Vector,@User_Sec_Data);
end;

Regards,

Dan Palley
TRAMS, Inc.

Quote
?yvind Myrseth <oyvind.myrs...@edbgruppen.no> wrote in message

news:7kvufa$f4513@forums.borland.com...
Quote
> Hi!

> I would like to create (or add) user to an Interbase (IB 5) database from
a
> Delphi application. And as far as I know the only way to do that is by
> calling certain API's.

> So my question is:
> How the heck can I get access to these API's from Delphi as every single
> example and source files supplied from Inprise / Interbase are made in C.

> I do not have a C-compiler.

> Pleas anyone!

> I'm soon beginning to believe it would have been a better choice to use
> SYBASE or ORACLE rather than Interbase??

> oyvind.myrs...@edbgruppen.no

Other Threads