4
votes

I'm trying to create new DB user for Firebird 2.5 DB from my C# application and geting an error "add record error no permission for insert/write access to TABLE USERS". I've granted rdb$admin role to the user, created connection to DB using this role yet still i'm getting this error. Wierdiest thing for me is that when i'm trying to create new user for my DB in IBExpert using same user settings and role (rdb$admin) it goes fine and I don't get eny errors.

What could be the problem? Why can't I execute SQL queries and procedures that update/insert in USERS table although I have appropriate role, that I'm using establishing connection?

I'm using latest FirebirdClient - ADO.NET Data Provider.

Connection string to the DB looks like this:

`"User=developer;Password=*****;Database=C:\DB.fdb;DataSource=*****;Port=*****;Dialect=3;Charset=NONE;Role=rdb$admin;Connection lifetime=15;Pooling=True;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;"`

Can somebody help me with this problem?

1
What statement do you use for creation of new user? - Andrej Kirejeŭ
I have a stored procedure for checking input parameters - so there i have: sql_statement = 'create user '||upper(:DB_LOGIN$)||' password '''||:DB_LOGIN$||''''; execute statement sql_statement; - J. Agapov
Try to grant role RDB$ADMIN to the procedure. - Andrej Kirejeŭ
Granting RDB$ADMIN role to the procedure didn't solved the problem. - J. Agapov

1 Answers

1
votes

I've found a solution - problem was that I forgot to GRANT ADMIN ROLE to the user by which I've executed procedure so I can't manage database users.

So GRANT ADMIN ROLE to user solved the problem.