#1 2017-02-22 23:40:05

afarias
Member
Registered: 2016-04-13
Posts: 14

How to set SQL Role on database connection?

I'm using FireDAC to connect to Firebird and could not figure out how to set user SQL Role

  URI := FIREDAC_PROVIDER[dFirebird];
  fProperties := TSQLDBFireDACConnectionProperties.Create(URI, DB_PATH, DB_USERNAME, DB_PASSWORD); // what about USER ROLE?

Since I don't want to connect using SYSDBA.

Another database connection param needed to set is database CharacterSet.

Any help is appreciated.

Offline

#2 2017-03-21 17:04:56

afarias
Member
Registered: 2016-04-13
Posts: 14

Re: How to set SQL Role on database connection?

Hi there, just figure it out. So, for anyone in the future:

Not very intuitive but (I just found out) you can pass an ilimited number of parameters using the AServerName on ConnectionProperties constructor, so in my case was:

  URI := FIREDAC_PROVIDER[dFirebird] + '?RoleName=SomeDbRole';
  fProperties := TSQLDBFireDACConnectionProperties.Create(URI, DB_PATH, DB_USERNAME, DB_PASSWORD);

Simple as that


Regards,

Offline

Board footer

Powered by FluxBB