with the new version 9.2 I have a problem with the attached code.
It's no longer working. I have to deactivate the Autoprepare := true line.
Why? This code has worked for a long time.
Regards
Jens
Code: Select all
function TForm1.HasSystemPrivilege(const Privilege: string): boolean;
var
Query: TOraQuery;
begin
Query := TOraQuery.Create(self);
try
try
Query.OptionsDS.AutoPrepare := True;
Query.SQL.Add('SELECT 2 ');
Query.SQL.Add(' FROM SESSION_PRIVS');
Query.SQL.Add(' WHERE PRIVILEGE =:PRIVILEGE');
Query.ParamByName('PRIVILEGE').AsString := Uppercase(trim(Privilege));
Query.Execute;
Result := not Query.EOF;
Query.Close;
except
on e: Exception do
Result := False;
end;
finally
Query.Free;
end;
if Result then
Memo1.Lines.Add(Format('%s granted',[Privilege]))
else
Memo1.Lines.Add(Format('%s not granted',[Privilege]));
end;