Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Allowed operations
Allowed operations
Posted: 2003/04/02 10:12
 
I need some solutions about "Allowed operations" parameter . How can I manipulate it . I try something like this :
(get_privilege is my function - returns boolean)
function TForm1.get_operations(table_name: string): TOCISQLKinds;
result:=[];
if get_privilege(table_name,'UPDATE') then
result:=result+skUpdate;
if get_privilege(table_name,'INSERT') then
result:=result+skInsert ........ etc
But it doesn't work . Some ideas ?

Thank's

RE: Allowed operations
Posted: 2003/04/03 07:49
 
What do you mean "doesn't work"?
Is it compiler error or incorrect value of Result? Be more informative!
Now I'll try to guess what's wrong:
you cannon uninon a set and an ordinal value. union operation (+) need both arguments to be sets.
try
>result:=result+[skUpdate];
instead of
>result:=result+skUpdate;
RE: Allowed operations
Posted: 2003/04/04 06:02
 
There's no error but after procedure when I see this property in control there are diffrent values .
RE: Allowed operations
Posted: 2003/04/04 10:10
 
Of course I made a mistake in first post :
I wrote in code
result:=result+[skUpdate] ..
There is no syntax error . But result has wrong values :
function TForm1.get_operations(tabela: string): TOCISQLKinds;
begin
Result:=[];
if get_privs(Uppercase(tabela),'UPDATE') then
result:=result+[skUpdate];
// here a value of result is [skLock..skRefresh,skUpdate] .. why ? //
if get_privs(uppercase(tabela),'INSERT') then
result:=result+[skInsert];
// here a value of result is [skLock..skRefresh,skInsert]
if get_privs(uppercase(tabela),'DELETE') then
result:=result+[skDelete];
//here a value of result is [skLock..skRefresh]
end;

I can't set property "AllowedOperations" properly

Best Regards
RE: Allowed operations
Posted: 2003/04/07 09:33
 
Are you sure that you analyze value of Result local variable, not value of TOCIQuery.AllowedOperations property?
This property has default value of [skLock .. skRefresh].
I can't see how it can work like you describe. There must be a mistake. Can you post a demo project or at least full function code?