Subject | RE: [IBO] error in alteruser |
---|---|
Author | Dmitriy A. Beloshistov |
Post date | 2008-04-14T14:30:06Z |
FB version? FB 2.0 - service API only...
Var ss:TIBOSecurityService;
// ......... Following code work for FB 1.5 and FB 2.x ..............
with ss do
begin
Params.Add('USER_NAME=' + edtLoginName.Text); // admin name
Params.Add('PASSWORD=' + edtLoginPswd.Text); // admin password
ServerName := ibc.Server; // IBC is TIB_Connection
UserName := edtAddUser.Text; // new user name
Password := edtAddUserPswd.Text; // new user password
Protocol := ibc.Protocol; // IB_Connection protocol
LoginPrompt := False; // this is important if you are supplying
login params
try
Attach;
try
if not Active then
begin
Active :=True;
ServiceStart;
end;
AddUser;
MessageDlg('User added successfully', mtInformation, [mbOK], 0);
except
ibc.IB_Session.HandleException(Sender);
SysUtils.Abort;
end;
finally
Detach;
end;
end;
For manipulation user right use special SQL statements as:
CREATE ROLE NEWROLE;
GRANR NEWROLE TO USERNAME;
GRANT SELECT ON MYTABLE TO USERNAME;
GRANT SELECT ON MYTABLE2 TO NEWROLE;
Etc - see IB/FB documentation for details......
You can execute these statements via using TIB_Query, TIB_DSQL
components...
WBR,Dmitry Beloshistov AKA [-=BDS=-]
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
Behalf Of Virtual Memory Developers of System
Sent: Monday, April 14, 2008 5:08 PM
To: ibobjects@yahoogroups.com; jason@...
Subject: [IBO] error in alteruser
i am using the command
try
DMMain.DbMain.AlterUser(uaAddUser,
QryL180L180_ID.AsString,
QryL180L180_SENHA.AsString,
'',
QryL180L180_ID.AsString,
'',
'' );
except
showmessage('User already exists!');
end
and return the error :
undeclared identifier: 'uaAddUser'
I need to add a user in the database directly from the application.
Thank you for help.
Flavio Macedo
Var ss:TIBOSecurityService;
// ......... Following code work for FB 1.5 and FB 2.x ..............
with ss do
begin
Params.Add('USER_NAME=' + edtLoginName.Text); // admin name
Params.Add('PASSWORD=' + edtLoginPswd.Text); // admin password
ServerName := ibc.Server; // IBC is TIB_Connection
UserName := edtAddUser.Text; // new user name
Password := edtAddUserPswd.Text; // new user password
Protocol := ibc.Protocol; // IB_Connection protocol
LoginPrompt := False; // this is important if you are supplying
login params
try
Attach;
try
if not Active then
begin
Active :=True;
ServiceStart;
end;
AddUser;
MessageDlg('User added successfully', mtInformation, [mbOK], 0);
except
ibc.IB_Session.HandleException(Sender);
SysUtils.Abort;
end;
finally
Detach;
end;
end;
For manipulation user right use special SQL statements as:
CREATE ROLE NEWROLE;
GRANR NEWROLE TO USERNAME;
GRANT SELECT ON MYTABLE TO USERNAME;
GRANT SELECT ON MYTABLE2 TO NEWROLE;
Etc - see IB/FB documentation for details......
You can execute these statements via using TIB_Query, TIB_DSQL
components...
WBR,Dmitry Beloshistov AKA [-=BDS=-]
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
Behalf Of Virtual Memory Developers of System
Sent: Monday, April 14, 2008 5:08 PM
To: ibobjects@yahoogroups.com; jason@...
Subject: [IBO] error in alteruser
i am using the command
try
DMMain.DbMain.AlterUser(uaAddUser,
QryL180L180_ID.AsString,
QryL180L180_SENHA.AsString,
'',
QryL180L180_ID.AsString,
'',
'' );
except
showmessage('User already exists!');
end
and return the error :
undeclared identifier: 'uaAddUser'
I need to add a user in the database directly from the application.
Thank you for help.
Flavio Macedo