Subject Programmatically grant role to user
Author jackmills75
I am trying to grant a role to a user from within my application.
Using TIBODatabase & TIBOQuery components. (recently converted from BDE)

The user exists on the server. "Joe"
The role exists in the database. "Mag_User"
User privileges exist for the role in the database.

I 1st obtain a list of users & select one & put the name into
(AnsiString) 'user' then I connect to the database & get the
role_names from RDB$ROLES, select one & put the role_name into
(AnsiString) 'role'.

Then I set the Query1->SQL->Add("Grant" role "To" user);

When the query is opened I get a exceptionclass EIB_Errror with
message "FieldNo: -1 not found, Process stopped.

The program then jumps to a line of code in IB_Components in the
function TIB_Row.GetColumnOldValue( const ColumnName: string ): Variant;
the - finally - statement.

When I try similar thing using isql, the role gets set to the user.

I am using C++ Builder 6, IBObjects 4.2

What am I doing wrong?
Any help greatly appreciated